Signed-off-by: Martin Koegler <mkoegler@xxxxxxxxxxxxxxxxx> --- Other parts of git add a NUL to buffers as safty measure, so why not index-pack/ unpack-objects too? index-pack.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/index-pack.c b/index-pack.c index 4bb333f..ff8e93d 100644 --- a/index-pack.c +++ b/index-pack.c @@ -213,7 +213,8 @@ static void bad_object(unsigned long offset, const char *format, ...) static void *unpack_entry_data(unsigned long offset, unsigned long size) { z_stream stream; - void *buf = xmalloc(size); + char *buf = xmalloc(size + 1); + buf[size] = 0; memset(&stream, 0, sizeof(stream)); stream.next_out = buf; -- 1.5.4.2.g4b5fd.dirty -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html