packfile: correct zlib buffer handling
[gitweb.git] / packfile.c
index 4a5fe7ab1883843a389ce74bf1c7bd89890d8e51..d55569921793ed8f16efef2d6908740888a06b4d 100644 (file)
@@ -1422,6 +1422,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;
 }