mirror of
https://github.com/git/git
synced 2024-08-28 20:20:07 +00:00
fsck: do not dereference NULL while checking resolve-undo data
When we found an invalid object recorded in the resolve-undo data, we would have ended up dereferencing NULL while fsck. Reporting the problem and going on to the next object is the right thing to do here. Noticed by SZEDER Gábor. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
5a5ea141e7
commit
e0ad13977a
|
@ -784,6 +784,7 @@ static int fsck_resolve_undo(struct index_state *istate)
|
||||||
error(_("%s: invalid sha1 pointer in resolve-undo"),
|
error(_("%s: invalid sha1 pointer in resolve-undo"),
|
||||||
oid_to_hex(&ru->oid[i]));
|
oid_to_hex(&ru->oid[i]));
|
||||||
errors_found |= ERROR_REFS;
|
errors_found |= ERROR_REFS;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
obj->flags |= USED;
|
obj->flags |= USED;
|
||||||
fsck_put_object_name(&fsck_walk_options, &ru->oid[i],
|
fsck_put_object_name(&fsck_walk_options, &ru->oid[i],
|
||||||
|
|
Loading…
Reference in a new issue