X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=sha1_file.c;h=956422ba4a5df5f46caaf85f10e4c85321439272;hb=3c06ab69b1dba95ff73edd23c2c89a9c72b1f7f9;hp=6dcae3882bf969cce9ae0a973a80abf76e3bb814;hpb=9e9ab407119d9b89a99bbf9e496428cac2f94468;p=git.git diff --git a/sha1_file.c b/sha1_file.c index 6dcae3882..956422ba4 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1267,7 +1267,8 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf, while (c & 0x80) { if (len <= used || bitsizeof(long) <= shift) { error("bad object header"); - return 0; + size = used = 0; + break; } c = buf[used++]; size += (c & 0x7f) << shift;