From 74016bbf735942bbc59f390bdcf298ad70ed299a Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 21 Nov 2023 09:25:58 +0100 Subject: [PATCH] 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 45e1d9b53e..c40f504371 100644 --- a/winsup/cygwin/msys2_path_conv.cc +++ b/winsup/cygwin/msys2_path_conv.cc @@ -490,7 +490,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); } @@ -519,7 +519,7 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en goto skip_p2w; return POSIX_PATH_LIST; } - } else if (memchr(it2, '=', end - it) == NULL) { + } else if (memchr(it2, '=', end - it2) == NULL) { return SIMPLE_WINDOWS_PATH; } } else if (ch != '.') {