summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRuediger Meier2017-06-27 20:32:52 +0200
committerRuediger Meier2017-06-27 21:39:35 +0200
commite230ae7b68814a2ea560e5138188a58128e34417 (patch)
tree8eaab2a06c417004a5477ad6cba769639eb72a76 /include
parentsetpriv: add --ambient-caps to usage() (diff)
downloadkernel-qcow2-util-linux-e230ae7b68814a2ea560e5138188a58128e34417.tar.gz
kernel-qcow2-util-linux-e230ae7b68814a2ea560e5138188a58128e34417.tar.xz
kernel-qcow2-util-linux-e230ae7b68814a2ea560e5138188a58128e34417.zip
lib/path: fix crash, pathbuf overflow
Before: $ lscpu -s "$(tr '\0' 'x' < /dev/zero | head -c 10000)" Segmentation fault (core dumped) After: $ lscpu -s "$(tr '\0' 'x' < /dev/zero | head -c 10000)" lscpu: invalid argument to --sysroot: File name too long Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'include')
-rw-r--r--include/path.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/path.h b/include/path.h
index 45da692f8..11c336759 100644
--- a/include/path.h
+++ b/include/path.h
@@ -27,7 +27,11 @@ extern cpu_set_t *path_read_cpuset(int, const char *path, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern cpu_set_t *path_read_cpulist(int, const char *path, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
-extern void path_set_prefix(const char *);
+
+/* Returns: 0 on success, sets errno on error. */
+extern int path_set_prefix(const char *)
+ __attribute__((warn_unused_result));
+
#endif /* HAVE_CPU_SET_T */
#endif /* UTIL_LINUX_PATH_H */