From 6a4927f2daba82f3a08ffb68c342394a33e68944 Mon Sep 17 00:00:00 2001
From: Kai Pastor <dg0yt@darc.de>
Date: Tue, 21 Nov 2023 09:25:58 +0100
Subject: [PATCH 49/N] fixup! Add functionality for converting UNIX paths in
 arguments and environment variables to Windows form for native Win32
 applications.

Don't memchr behind end, it2
---
 winsup/cygwin/msys2_path_conv.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc
index e6f8f7c..68cd6cc 100644
--- a/winsup/cygwin/msys2_path_conv.cc
+++ b/winsup/cygwin/msys2_path_conv.cc
@@ -428,7 +428,7 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
             if (isalpha(ch) && (*(it2+1) == ':') && (*(it2+2) == '/')) {
                 return SIMPLE_WINDOWS_PATH;
             }
-            if (ch == '/'&& memchr(it2, ',', end - it) == NULL) {
+            if (ch == '/'&& memchr(it2, ',', end - it2) == NULL) {
                 *src = it2;
                 return find_path_start_and_type(src, true, end);
             }
@@ -455,7 +455,7 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
                 } else {
                     return POSIX_PATH_LIST;
                 }
-            } else if (memchr(it2, '=', end - it) == NULL) {
+            } else if (memchr(it2, '=', end - it2) == NULL) {
                 return SIMPLE_WINDOWS_PATH;
             }
         }
