Skip to content

Commit c9c0828

Browse files
committed
Merge branch 'jt/pack-header-lshift-overflow'
* jt/pack-header-lshift-overflow: packfile: fix off-by-one error in decoding logic
2 parents 4e2e2a4 + a5c97b0 commit c9c0828

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
10691069
size = c & 15;
10701070
shift = 4;
10711071
while (c & 0x80) {
1072-
if (len <= used || (bitsizeof(long) - 7) <= shift) {
1072+
if (len <= used || (bitsizeof(long) - 7) < shift) {
10731073
error("bad object header");
10741074
size = used = 0;
10751075
break;

0 commit comments

Comments
 (0)