summaryrefslogtreecommitdiffstats
path: root/sys-utils/lscpu.c
diff options
context:
space:
mode:
authorRuediger Meier2017-06-27 20:32:52 +0200
committerRuediger Meier2017-06-27 21:39:35 +0200
commite230ae7b68814a2ea560e5138188a58128e34417 (patch)
tree8eaab2a06c417004a5477ad6cba769639eb72a76 /sys-utils/lscpu.c
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 'sys-utils/lscpu.c')
-rw-r--r--sys-utils/lscpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 424b9de0e..f6e47277e 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -2148,7 +2148,8 @@ int main(int argc, char *argv[])
mod->mode = c == 'p' ? OUTPUT_PARSABLE : OUTPUT_READABLE;
break;
case 's':
- path_set_prefix(optarg);
+ if(path_set_prefix(optarg))
+ err(EXIT_FAILURE, _("invalid argument to %s"), "--sysroot");
mod->system = SYSTEM_SNAPSHOT;
break;
case 'x':