Commit 1c47a8f
committed
sparse-index: fix crash in status
Copy the `index_state->dir_hash` back to the real istate
after expanding a sparse index.
A crash was observed in `git status` during some hashmap lookups with
corrupted hashmap entries. During an index expansion, new cache-entries
are added to the `index_state->name_hash` and the `dir_hash` in a
temporary `index_state` variable `full`. However, only the `name_hash`
hashmap from this temp variable was copied back into the real `istate`
variable. The original copy of the `dir_hash` was incorrectly preserved.
If the table in the `full->dir_hash` hashmap were realloced, the
stale version (in `istate`) would be corrupted.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>1 parent 596b5ac commit 1c47a8f
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
298 | 299 | | |
299 | 300 | | |
300 | 301 | | |
| |||
0 commit comments