Skip to content

Commit 294dd20

Browse files
committed
Merge branch 'jh/sparse-index-expand-to-path-fix'
A caller called index_file_exists() that takes a string expressed as <ptr, length> with a wrong length, which has been corrected. * jh/sparse-index-expand-to-path-fix: sparse-index: pass string length to index_file_exists()
2 parents 33d03f6 + 156e28b commit 294dd20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sparse-index.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,9 @@ void expand_to_path(struct index_state *istate,
579579
replace++;
580580
temp = *replace;
581581
*replace = '\0';
582+
substr_len = replace - path_mutable.buf;
582583
if (index_file_exists(istate, path_mutable.buf,
583-
path_mutable.len, icase)) {
584+
substr_len, icase)) {
584585
/*
585586
* We found a parent directory in the name-hash
586587
* hashtable, because only sparse directory entries
@@ -593,7 +594,6 @@ void expand_to_path(struct index_state *istate,
593594
}
594595

595596
*replace = temp;
596-
substr_len = replace - path_mutable.buf;
597597
}
598598

599599
cleanup:

0 commit comments

Comments
 (0)