diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-02-08 13:20:34 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-02-08 13:20:34 -0800 |
| commit | 294dd2057cdabceca0bce4c009d9368c93ef434a (patch) | |
| tree | 6f800e7c7fcd116f2649946ab79f5e551f303662 /sparse-index.c | |
| parent | Merge branch 'pb/imap-send-wo-curl-build-fix' (diff) | |
| parent | sparse-index: pass string length to index_file_exists() (diff) | |
| download | git-294dd2057cdabceca0bce4c009d9368c93ef434a.tar.gz git-294dd2057cdabceca0bce4c009d9368c93ef434a.zip | |
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()
Diffstat (limited to 'sparse-index.c')
| -rw-r--r-- | sparse-index.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sparse-index.c b/sparse-index.c index 3578feb283..e48e40cae7 100644 --- a/sparse-index.c +++ b/sparse-index.c @@ -579,8 +579,9 @@ void expand_to_path(struct index_state *istate, replace++; temp = *replace; *replace = '\0'; + substr_len = replace - path_mutable.buf; if (index_file_exists(istate, path_mutable.buf, - path_mutable.len, icase)) { + substr_len, icase)) { /* * We found a parent directory in the name-hash * hashtable, because only sparse directory entries @@ -593,7 +594,6 @@ void expand_to_path(struct index_state *istate, } *replace = temp; - substr_len = replace - path_mutable.buf; } cleanup: |
