From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Adam Murray via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Adam Murray <ad@canva.com>
Subject: Re: [PATCH v2] trace2: prevent segfault on config collection where no value specified
Date: Wed, 22 Jan 2025 10:12:50 -0800 [thread overview]
Message-ID: <xmqqfrlawwd9.fsf@gitster.g> (raw)
In-Reply-To: <c1398676-ddd7-c161-e114-2249316b5311@gmx.de> (Johannes Schindelin's message of "Wed, 22 Jan 2025 11:11:14 +0100 (CET)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> This patch looks good to me!
Thanks. As I punted on reviewing the tgt_perf part, it is very good
to see somebody else step in to look it over.
Will queue.
>> diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
>> index a6f9a8a193e..19ae7433ef8 100644
>> --- a/trace2/tr2_tgt_perf.c
>> +++ b/trace2/tr2_tgt_perf.c
>> @@ -446,8 +446,9 @@ static void fn_param_fl(const char *file, int line, const char *param,
>> struct strbuf scope_payload = STRBUF_INIT;
>> enum config_scope scope = kvi->scope;
>> const char *scope_name = config_scope_name(scope);
>> -
>> - strbuf_addf(&buf_payload, "%s:%s", param, value);
>> + strbuf_addstr(&buf_payload, param);
>> + if (value)
>> + strbuf_addf(&buf_payload, ":%s", value);
>> strbuf_addf(&scope_payload, "%s:%s", "scope", scope_name);
>>
>> perf_io_write_fl(file, line, event_name, NULL, NULL, NULL,
>>
>> base-commit: 8f8d6eee531b3fa1a8ef14f169b0cb5035f7a772
>> --
>> gitgitgadget
>>
>>
next prev parent reply other threads:[~2025-01-22 18:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 0:04 [PATCH] trace2: prevent segfault on config collection where no value specified Adam Murray via GitGitGadget
2024-11-07 2:01 ` Jeff King
2024-11-07 3:02 ` Junio C Hamano
2025-01-10 7:28 ` [PATCH v2] " Adam Murray via GitGitGadget
2025-01-10 17:10 ` Junio C Hamano
2025-01-22 10:11 ` Johannes Schindelin
2025-01-22 18:12 ` Junio C Hamano [this message]
2025-01-22 18:18 ` Junio C Hamano
2025-01-23 17:01 ` D. Ben Knoble
2025-01-23 18:02 ` Junio C Hamano
2025-01-23 21:15 ` D. Ben Knoble
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqfrlawwd9.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=ad@canva.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).