]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/index-pack.c
index-pack: detect local corruption in collision check
[thirdparty/git.git] / builtin / index-pack.c
index 88d205f858e93f6d7c8fca17803fc6fadee47750..9f17adb37ba05d1d7e2ca2d00283091c02499053 100644 (file)
@@ -809,6 +809,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
                unsigned long has_size;
                read_lock();
                has_type = sha1_object_info(sha1, &has_size);
+               if (has_type < 0)
+                       die(_("cannot read existing object info %s"), sha1_to_hex(sha1));
                if (has_type != type || has_size != size)
                        die(_("SHA1 COLLISION FOUND WITH %s !"), sha1_to_hex(sha1));
                has_data = read_sha1_file(sha1, &has_type, &has_size);