lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 2 Aug 2023 17:47:24 +0800
From:   Jing Zhang <renyu.zj@...ux.alibaba.com>
To:     John Garry <john.g.garry@...cle.com>
Cc:     Ian Rogers <irogers@...gle.com>, Will Deacon <will@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Robin Murphy <robin.murphy@....com>,
        Ilkka Koskinen <ilkka@...amperecomputing.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-perf-users@...r.kernel.org, linux-doc@...r.kernel.org,
        Zhuo Song <zhuo.song@...ux.alibaba.com>,
        Shuai Xue <xueshuai@...ux.alibaba.com>
Subject: Re: [PATCH v5 1/5] perf metric: Event "Compat" value supports
 matching multiple identifiers



在 2023/8/2 下午5:43, John Garry 写道:
> On 02/08/2023 10:38, Jing Zhang wrote:
>>>>> n;
>>>>> +
>>>>> +    str = strdup(compat);
>>>> why duplicate this? are you modifying something?
>>>>
>>> This is really a redundant step, I will remove it.
>>>
>> Hi John,
>>
>> I reviewed this code again and found that it still needs to duplicate "compat" because "compat" is a
>> const str* type and cannot be used as a parameter for the strtok_r function. If it is cast to char*,
>> using "compat" as a parameter for strtok_r is also unsafe and can cause a "Segmentation fault" error.
>> Therefore, let's keep the step of duplicating "compat".
> 
> ok, so then please add a small comment on why the strdup() call is needed.
> 

No problem.

Thanks,
Jing

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ