From a620db7025bd6b38c58dcf07ec147100dfd53006 Mon Sep 17 00:00:00 2001 From: Dylan Conway <35280289+dylan-conway@users.noreply.github.com> Date: Sat, 1 Mar 2025 03:10:53 -0800 Subject: [PATCH] Fix incorrect string indexing in Git config parsing (#17832) --- src/install/repository.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/install/repository.zig b/src/install/repository.zig index 3b16f623a5..3ca3c3c79d 100644 --- a/src/install/repository.zig +++ b/src/install/repository.zig @@ -110,7 +110,7 @@ const SloppyGlobalGitConfig = struct { } } else { if (!found_askpass) { - if (line.len > "core.askpass".len and strings.eqlCaseInsensitiveASCIIIgnoreLength(line[0.."core.askpass".len], "core.askpass") and switch (line["sshCommand".len]) { + if (line.len > "core.askpass".len and strings.eqlCaseInsensitiveASCIIIgnoreLength(line[0.."core.askpass".len], "core.askpass") and switch (line["core.askpass".len]) { ' ', '\t', '=' => true, else => false, }) { @@ -120,7 +120,7 @@ const SloppyGlobalGitConfig = struct { } if (!found_ssh_command) { - if (line.len > "core.sshCommand".len and strings.eqlCaseInsensitiveASCIIIgnoreLength(line[0.."core.sshCommand".len], "core.sshCommand") and switch (line["sshCommand".len]) { + if (line.len > "core.sshCommand".len and strings.eqlCaseInsensitiveASCIIIgnoreLength(line[0.."core.sshCommand".len], "core.sshCommand") and switch (line["core.sshCommand".len]) { ' ', '\t', '=' => true, else => false, }) {