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
path: root/dir.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-04-25 10:41:22 +0300
committerJunio C Hamano <gitster@pobox.com>2019-04-25 10:41:22 +0300
commit0830eac14cf6d0f0392a3a87d96f916e79dc4319 (patch)
tree590b6c791f22339b145d79042127206f4f2bd58c /dir.c
parentaf152bd5b04933239f338044d43e63b549b97ea6 (diff)
parent3a7b45a62360ff0e14f7150ee2d9930c0c258dbd (diff)
Merge branch 'js/untracked-cache-allocfix'
An underallocation in the code to read the untracked cache extension has been corrected. * js/untracked-cache-allocfix: untracked cache: fix off-by-one
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 1c488b5200..ad30a5a46d 100644
--- a/dir.c
+++ b/dir.c
@@ -2756,7 +2756,7 @@ static int read_one_dir(struct untracked_cache_dir **untracked_,
next = data + len + 1;
if (next > rd->end)
return -1;
- *untracked_ = untracked = xmalloc(st_add(sizeof(*untracked), len));
+ *untracked_ = untracked = xmalloc(st_add3(sizeof(*untracked), len, 1));
memcpy(untracked, &ud, sizeof(ud));
memcpy(untracked->name, data, len + 1);
data = next;