提交 ea4f9685 编写于 作者: J Junio C Hamano

unpack_object_header_buffer(): clear the size field upon error

The callers do not use the returned size when the function says
it did not use any bytes and sets the type to OBJ_BAD, so this
should not matter in practice, but it is a good code hygiene
anyway.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 9c6bebd1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册