From 6d63f4b63af72aa41e41be3d7b3acaf5b093fd33 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 17 Sep 2025 11:05:30 +0300 Subject: [PATCH] config: Fix potential null value passed to %s config.c:1448:59: warning: '%s' directive argument is null [-Wformat-overflow=] 1448 | git_error_set(GIT_ERROR_CONFIG, "failed to parse '%s' as a boolean value", value); | ^~ --- src/libgit2/config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libgit2/config.c b/src/libgit2/config.c index b16d981d8..65772fcbe 100644 --- a/src/libgit2/config.c +++ b/src/libgit2/config.c @@ -1442,6 +1442,8 @@ int git_config_parse_bool(int *out, const char *value) if (git__parse_bool(out, value) == 0) return 0; + /* git__parse_bool returns 0 for NULL, so this assertion should be correct */ + GIT_ASSERT_ARG(value); if (git_config_parse_int32(out, value) == 0) { *out = !!(*out); return 0;