lkml.org 
[lkml]   [2014]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 2/3] perf tools: parse the pmu event prefix and surfix
> +	while ((pmu = perf_pmu__scan(pmu)) != NULL)
> + list_for_each_entry(alias, &pmu->aliases, list) {
> + if (!strcmp(pmu->name, "cpu")) {
> + struct kernel_pmu_event_symbol *p =
> + kernel_pmu_events_list + len;
> + char *tmp = strchr(alias->name, '-');
> +
> + if (tmp != NULL) {
> + strncpy(p->symbol, alias->name,
> + tmp - alias->name);

Please use strlcpy(). Otherwise p->symbol may not be zero terminated.

The rest of the patch looks good to me.

-Andi


\
 
 \ /
  Last update: 2014-08-27 18:41    [W:0.996 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site