summaryrefslogtreecommitdiff
path: root/ll-merge.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2016-02-19 06:21:08 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-02-19 09:40:37 -0800
commitc3a700fba1693f68643f24c4f2e6d4cdd240babf (patch)
treeb14585b2a3c505d6ee2aadd2dac2eaf338680def /ll-merge.c
parentGit 2.7.1 (diff)
downloadtgif-c3a700fba1693f68643f24c4f2e6d4cdd240babf.tar.xz
reflog_expire_cfg: NUL-terminate pattern field
You can tweak the reflog expiration for a particular subset of refs by configuring gc.foo.reflogexpire. We keep a linked list of reflog_expire_cfg structs, each of which holds the pattern and a "len" field for the length of the pattern. The pattern itself is _not_ NUL-terminated. However, we feed the pattern directly to wildmatch(), which expects a NUL-terminated string, meaning it may keep reading random junk after our struct. We can fix this by allocating an extra byte for the NUL (which is already zero because we use xcalloc). Let's also drop the misleading "len" field, which is no longer necessary. The existing use of "len" can be converted to use strncmp(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'll-merge.c')
0 files changed, 0 insertions, 0 deletions