Skip to content

Commit e0ad139

Browse files
committed
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 <[email protected]>
1 parent 5a5ea14 commit e0ad139

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/fsck.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ static int fsck_resolve_undo(struct index_state *istate)
784784
error(_("%s: invalid sha1 pointer in resolve-undo"),
785785
oid_to_hex(&ru->oid[i]));
786786
errors_found |= ERROR_REFS;
787+
continue;
787788
}
788789
obj->flags |= USED;
789790
fsck_put_object_name(&fsck_walk_options, &ru->oid[i],

0 commit comments

Comments
 (0)