From 871ae708f5e5234cf2d6ad91c5dab905fe38f1d7 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 27 Feb 2024 20:47:41 +0100 Subject: [PATCH] path_conv: backport forgotten part of msys2/msys2-runtime#179 In https://github.com/msys2/msys2-runtime/pull/179 ("Fix out-of-bound access in path conversion"), _two_ instances were fixed where `it` was used when `it2` should have been used instead. In 3a20d2f (Sync path_conv.pp with msys2-runtime, 2023-12-22), only one of those fixes was applied. Let's apply the other one, too. Signed-off-by: Johannes Schindelin --- runtime/path_convert/src/path_conv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/path_convert/src/path_conv.cpp b/runtime/path_convert/src/path_conv.cpp index 14540c0..e5206f4 100644 --- a/runtime/path_convert/src/path_conv.cpp +++ b/runtime/path_convert/src/path_conv.cpp @@ -551,7 +551,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 != '.') {