diff options
author | Nate Avers <nate@roosteregg.cc> | 2020-11-23 04:23:41 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-23 19:42:22 +0100 |
commit | c3eb95a0d759d80d53ccb396627c400cd3db6e6d (patch) | |
tree | d5666fa66e8182f546750e524fc07eae13820685 /notes.c | |
parent | Git 2.24.3 (diff) | |
download | git-c3eb95a0d759d80d53ccb396627c400cd3db6e6d.tar.xz git-c3eb95a0d759d80d53ccb396627c400cd3db6e6d.zip |
notes.c: fix a segfault in notes_display_config()
If notes.displayRef is configured with no value[1], control should be
returned to the caller when notes.c:notes_display_config() checks if 'v'
is NULL. Otherwise, both git log --notes and git diff-tree --notes will
subsequently segfault when refs.h:has_glob_specials() calls strpbrk()
with a NULL first argument.
[1] Examples:
.git/config:
[notes]
displayRef
$ git -c notes.displayRef [...]
Signed-off-by: Nate Avers <nate@roosteregg.cc>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes.c')
-rw-r--r-- | notes.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -967,7 +967,7 @@ static int notes_display_config(const char *k, const char *v, void *cb) if (*load_refs && !strcmp(k, "notes.displayref")) { if (!v) - config_error_nonbool(k); + return config_error_nonbool(k); string_list_add_refs_by_glob(&display_notes_refs, v); } |