diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index bbed90e5d9bb841782ed878a0c2ce1ae752418f9..cee717a3794fe851fcc18f7351002a37258d6f72 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -295,7 +295,7 @@ static int decompress_kmodule(struct dso *dso, const char *name, unlink(tmpbuf); if (pathname && (fd >= 0)) - strncpy(pathname, tmpbuf, len); + strlcpy(pathname, tmpbuf, len); return fd; }