mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Fix incorrect string indexing in Git config parsing (#17832)
This commit is contained in:
@@ -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,
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user