Skip to content
Permalink
Browse files

Merge pull request #2182 from dscho/untracked-cache-off-by-one

Backport "untracked cache: fix off-by-one"
  • Loading branch information...
dscho committed May 7, 2019
2 parents 1059065 + 7d8caf9 commit c63a3d503f9c2e13fdb87ebf10431845a7e30e51
Showing with 1 addition and 1 deletion.
  1. +1 −1 dir.c
2 dir.c
@@ -2803,7 +2803,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;

0 comments on commit c63a3d5

Please sign in to comment.
You can’t perform that action at this time.