summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-18 17:18:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-18 17:18:43 (GMT)
commitfaff81287b5d69ef14408de22d3919cc7ff0ac06 (patch)
tree5937e0b794c232d98318c3bc04110e6485d7286e
parent094381ed79f4f0b67f30502da1202ff627261645 (diff)
parentb611396e97cba09c7e1cf900190cf1a9e922546e (diff)
downloadgit-faff81287b5d69ef14408de22d3919cc7ff0ac06.zip
git-faff81287b5d69ef14408de22d3919cc7ff0ac06.tar.gz
git-faff81287b5d69ef14408de22d3919cc7ff0ac06.tar.bz2
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
-rw-r--r--packfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/packfile.c b/packfile.c
index 1a714fb..7cd45aa 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1454,6 +1454,9 @@ static void *unpack_compressed_entry(struct packed_git *p,
return NULL;
}
+ /* versions of zlib can clobber unconsumed portion of outbuf */
+ buffer[size] = '\0';
+
return buffer;
}