From e48f7247c9515a69b8f8d34eab3b00906f454a62 Mon Sep 17 00:00:00 2001 From: Adam Murray Date: Tue, 7 Jan 2025 13:52:53 +1000 Subject: [PATCH] When TRACE2 analytics is enabled, a git config option that has no value causes a segfault. Steps to Reproduce GIT_TRACE2=true GIT_TRACE2_CONFIG_PARAMS=status.* git -c status.relativePaths version Expected Result git version 2.46.0 Actual Result zsh: segmentation fault GIT_TRACE2=true This adds checks to prevent the segfault and instead return an empty value. Signed-off-by: Adam Murray --- trace2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trace2.c b/trace2.c index 449ba6af6330e9..49e7d1db88f8a3 100644 --- a/trace2.c +++ b/trace2.c @@ -759,7 +759,7 @@ void trace2_def_param_fl(const char *file, int line, const char *param, int j; const char *redacted; - if (!trace2_enabled || !value) + if (!trace2_enabled) return; redacted = value ? redact_arg(value): NULL;