diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index bd9226bc59458b813200056c9cb2acc6c56928a3..b9a82598e2ac3970fd298b3c3c44bb875f1c58a2 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -3562,7 +3562,7 @@ perf_event__synthesize_event_update_name(struct perf_tool *tool, if (ev == NULL) return -ENOMEM; - strncpy(ev->data, evsel->name, len); + strlcpy(ev->data, evsel->name, len + 1); err = process(tool, (union perf_event*) ev, NULL, NULL); free(ev); return err;