Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'js/untracked-cache-allocfix'
author
Junio C Hamano
<gitster@pobox.com>
Thu, 25 Apr 2019 07:41:22 +0000
(16:41 +0900)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 25 Apr 2019 07:41:22 +0000
(16:41 +0900)
An underallocation in the code to read the untracked cache
extension has been corrected.
* js/untracked-cache-allocfix:
untracked cache: fix off-by-one
dir.c
patch
|
blob
|
history
raw
(from parent 1:
af152bd
)
diff --git
a/dir.c
b/dir.c
index 1c488b52003913940b053178b8dce3a06838b0b5..ad30a5a46dd8d902874d3c3185f905c13a18ba7f 100644
(file)
--- 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_add
3(sizeof(*untracked), len, 1
));
memcpy(untracked, &ud, sizeof(ud));
memcpy(untracked->name, data, len + 1);
data = next;