Merge branch 'jt/pack-header-lshift-overflow'
* jt/pack-header-lshift-overflow: packfile: fix off-by-one error in decoding logic
This commit is contained in:
commit
c9c082850d
@ -1069,7 +1069,7 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
|
||||
size = c & 15;
|
||||
shift = 4;
|
||||
while (c & 0x80) {
|
||||
if (len <= used || (bitsizeof(long) - 7) <= shift) {
|
||||
if (len <= used || (bitsizeof(long) - 7) < shift) {
|
||||
error("bad object header");
|
||||
size = used = 0;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user