X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=sha1_file.c;fp=sha1_file.c;h=833f5b9b5820ce60f9fb99f6c9bcdb313ae8fca9;hb=ea4f9685cb432caf357ad8af56a91877b6d04663;hp=27f3b9b278a97f66f92ca61a2bc39e30f0a70317;hpb=9c6bebd14233af291ffb8dde2975b06c76e9ce5f;p=git.git diff --git a/sha1_file.c b/sha1_file.c index 27f3b9b27..833f5b9b5 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;