Messages in this thread | | | Date | Wed, 27 Aug 2014 09:22:46 -0700 | From | Andi Kleen <> | Subject | Re: [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
| |