Skip to content

Commit

Permalink
Merge pull request #2182 from dscho/untracked-cache-off-by-one
Browse files Browse the repository at this point in the history
Backport "untracked cache: fix off-by-one"
  • Loading branch information
dscho authored and Git for Windows Build Agent committed May 14, 2019
2 parents b596df2 + 484b269 commit df43686
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -2760,7 +2760,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;
Expand Down

0 comments on commit df43686

Please sign in to comment.