mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Merge branch 'ds/sparse-updates-oob-access-fix'
The code to skip unmerged paths in the index when sparse checkout is in use would have made out-of-bound access of the in-core index when the last path was unmerged, which has been corrected. * ds/sparse-updates-oob-access-fix: unpack-trees: avoid array out-of-bounds error
This commit is contained in:
commit
ce1adb1157
|
@ -562,11 +562,11 @@ static int warn_conflicted_path(struct index_state *istate,
|
|||
|
||||
add_rejected_path(o, WARNING_SPARSE_UNMERGED_FILE, conflicting_path);
|
||||
|
||||
/* Find out how many higher stage entries at same path */
|
||||
while (++count < istate->cache_nr &&
|
||||
!strcmp(conflicting_path,
|
||||
istate->cache[i+count]->name))
|
||||
/* do nothing */;
|
||||
/* Find out how many higher stage entries are at same path */
|
||||
while ((++count) + i < istate->cache_nr &&
|
||||
!strcmp(conflicting_path, istate->cache[count + i]->name))
|
||||
; /* do nothing */
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue