1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 12:36:08 +02:00

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:
Junio C Hamano 2022-01-12 15:11:41 -08:00
commit c9c082850d

View File

@ -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;