Skip to content

Commit faff812

Browse files
committed
Merge branch 'jl/zlib-restore-nul-termination'
Make zlib inflate codepath more robust against versions of zlib that clobber unused portion of outbuf. * jl/zlib-restore-nul-termination: packfile: correct zlib buffer handling
2 parents 094381e + b611396 commit faff812

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packfile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,9 @@ static void *unpack_compressed_entry(struct packed_git *p,
14541454
return NULL;
14551455
}
14561456

1457+
/* versions of zlib can clobber unconsumed portion of outbuf */
1458+
buffer[size] = '\0';
1459+
14571460
return buffer;
14581461
}
14591462

0 commit comments

Comments
 (0)