]> git.ipfire.org Git - thirdparty/git.git/commit
trace2: prevent segfault on config collection with valueless true
authorAdam Murray <ad@canva.com>
Fri, 10 Jan 2025 07:28:20 +0000 (07:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Jan 2025 18:01:56 +0000 (10:01 -0800)
commit2fd367cf63cd5f94368340cc6fe1cd0a3fb021df
tree8543686f0704c7c216059771088b04be01778252
parent5c21db3a0d5f4414b65e114ca21c5a1fe736f2bc
trace2: prevent segfault on config collection with valueless true

When TRACE2 analytics is enabled, a configuration variable set to
"valueless true" 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

Add checks to prevent the segfault and instead show that the
variable without value.

Signed-off-by: Adam Murray <ad@canva.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0210-trace2-normal.sh
trace2.c
trace2/tr2_tgt_event.c
trace2/tr2_tgt_normal.c
trace2/tr2_tgt_perf.c