Re: [PATCH v2] trace2: prevent segfault on config collection where no value specified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> 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
>>
>>




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux