From 0d8fe0738820f88e38b7c78d05101aaa38fb6788 Mon Sep 17 00:00:00 2001 From: imp0s5ible Date: Sun, 29 Mar 2026 21:24:57 +0200 Subject: [PATCH] Fix array-bounds-exceeded error We didn't consider empty base/target strings and accessed the ith element unconditionally. We now check to make sure `i` is in range. --- core/os/path_windows.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/os/path_windows.odin b/core/os/path_windows.odin index 98e26f929..83100ad69 100644 --- a/core/os/path_windows.odin +++ b/core/os/path_windows.odin @@ -349,7 +349,7 @@ _get_common_path_len :: proc(base, target: string) -> int { end := min(len(base), len(target)) for j in 0..=end { if j == end || _is_path_separator(base[j]) { - if _is_path_separator(base[i]) && _is_path_separator(target[i]) { + if i < end && _is_path_separator(base[i]) && _is_path_separator(target[i]) { i += 1 } if strings.equal_fold(base[i:j], target[i:j]) {