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
maint
Junio C Hamano 2018-06-18 10:18:43 -07:00
commit faff81287b
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}