Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-18 20:18:43 +0300
committerJunio C Hamano <gitster@pobox.com>2018-06-18 20:18:43 +0300
commitfaff81287b5d69ef14408de22d3919cc7ff0ac06 (patch)
tree5937e0b794c232d98318c3bc04110e6485d7286e /packfile.c
parent094381ed79f4f0b67f30502da1202ff627261645 (diff)
parentb611396e97cba09c7e1cf900190cf1a9e922546e (diff)
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
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/packfile.c b/packfile.c
index 1a714fbde9..7cd45aa4b2 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;
}