Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Avers <nate@roosteregg.cc>2020-11-23 06:23:41 +0300
committerJunio C Hamano <gitster@pobox.com>2020-11-23 21:42:22 +0300
commitc3eb95a0d759d80d53ccb396627c400cd3db6e6d (patch)
treed5666fa66e8182f546750e524fc07eae13820685 /notes.c
parentb86a4be245d0ba077c97c6ab6b1cdbeb9dcc1342 (diff)
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/notes.c b/notes.c
index 03e7d0cd2d..928dde8b34 100644
--- a/notes.c
+++ b/notes.c
@@ -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);
}