зеркало из https://github.com/microsoft/git.git
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
This commit is contained in:
Коммит
0830eac14c
2
dir.c
2
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче