summaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-12-22 12:27:41 -0800
committerJunio C Hamano <gitster@pobox.com>2014-12-22 12:27:41 -0800
commit1cb4b3d380fe42a837adfb68126a312f605680f8 (patch)
treea3051c8af64dda52e0c1b0c9826afa0d2d66515c /builtin/index-pack.c
parent14d4aab3bbd4cb25a4ccd16dc778c4c6c0a77c73 (diff)
parenta1e920a0a7747f0820e62b22b67fd36fb1d74607 (diff)
downloadgit-1cb4b3d380fe42a837adfb68126a312f605680f8.tar.gz
Merge branch 'js/fsck-tag-validation'
New tag object format validation added in 2.2 showed garbage after a tagname it reported in its error message. * js/fsck-tag-validation: index-pack: terminate object buffers with NUL fsck: properly bound "invalid tag name" error message
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index a369f55353..4632117671 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -447,7 +447,7 @@ static void *unpack_entry_data(unsigned long offset, unsigned long size,
if (type == OBJ_BLOB && size > big_file_threshold)
buf = fixed_buf;
else
- buf = xmalloc(size);
+ buf = xmallocz(size);
memset(&stream, 0, sizeof(stream));
git_inflate_init(&stream);
@@ -552,7 +552,7 @@ static void *unpack_data(struct object_entry *obj,
git_zstream stream;
int status;
- data = xmalloc(consume ? 64*1024 : obj->size);
+ data = xmallocz(consume ? 64*1024 : obj->size);
inbuf = xmalloc((len < 64*1024) ? len : 64*1024);
memset(&stream, 0, sizeof(stream));