Merge branch 'rs/fix-alt-odb-path-comparison'
* rs/fix-alt-odb-path-comparison: sha1_file: avoid overrunning alternate object base string
This commit is contained in:
@ -315,7 +315,8 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base, int
|
|||||||
* thing twice, or object directory itself.
|
* thing twice, or object directory itself.
|
||||||
*/
|
*/
|
||||||
for (alt = alt_odb_list; alt; alt = alt->next) {
|
for (alt = alt_odb_list; alt; alt = alt->next) {
|
||||||
if (!memcmp(ent->base, alt->base, pfxlen)) {
|
if (pfxlen == alt->name - alt->base - 1 &&
|
||||||
|
!memcmp(ent->base, alt->base, pfxlen)) {
|
||||||
free(ent);
|
free(ent);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user