aboutsummaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-02-19 06:21:08 -0500
committerJunio C Hamano <gitster@pobox.com>2016-02-19 09:40:37 -0800
commitc3a700fba1693f68643f24c4f2e6d4cdd240babf (patch)
treeb14585b2a3c505d6ee2aadd2dac2eaf338680def /git-compat-util.h
parenta08595f76159b09d57553e37a5123f1091bb13e7 (diff)
downloadgit-c3a700fba1693f68643f24c4f2e6d4cdd240babf.tar.gz
git-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 'git-compat-util.h')
0 files changed, 0 insertions, 0 deletions