[PATCH 2/1] fsck: do not dereference NULL while checking resolve-undo data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <szeder.dev@xxxxxxxxx>.

Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---
 builtin/fsck.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/builtin/fsck.c b/builtin/fsck.c
index 4b17ccc3f4..6c73092f10 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -784,6 +784,7 @@ static int fsck_resolve_undo(struct index_state *istate)
 				error(_("%s: invalid sha1 pointer in resolve-undo"),
 				      oid_to_hex(&ru->oid[i]));
 				errors_found |= ERROR_REFS;
+				continue;
 			}
 			obj->flags |= USED;
 			fsck_put_object_name(&fsck_walk_options, &ru->oid[i],
-- 
2.37.0-248-g2505070554





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux