diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-04-25 16:41:22 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-25 16:41:22 +0900 |
commit | 0830eac14cf6d0f0392a3a87d96f916e79dc4319 (patch) | |
tree | 590b6c791f22339b145d79042127206f4f2bd58c /dir.c | |
parent | Merge branch 'js/t3301-unbreak-notes-test' (diff) | |
parent | untracked cache: fix off-by-one (diff) | |
download | tgif-0830eac14cf6d0f0392a3a87d96f916e79dc4319.tar.xz |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |