diff options
Diffstat (limited to '')
-rw-r--r-- | tools/perf/builtin-help.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 3976aebe3677..b2a368ae295a 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c @@ -14,10 +14,12 @@ #include <subcmd/run-command.h> #include <subcmd/help.h> #include "util/debug.h" +#include "util/util.h" #include <linux/kernel.h> #include <linux/string.h> #include <linux/zalloc.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -388,9 +390,10 @@ static int get_html_page_path(char **page_path, const char *page) { struct stat st; const char *html_path = system_path(PERF_HTML_PATH); + char path[PATH_MAX]; /* Check that we have a perf documentation directory. */ - if (stat(mkpath("%s/perf.html", html_path), &st) + if (stat(mkpath(path, sizeof(path), "%s/perf.html", html_path), &st) || !S_ISREG(st.st_mode)) { pr_err("'%s': not a documentation directory.", html_path); return -1; |