summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPere Orga2011-03-07 16:22:17 +0100
committerDenys Vlasenko2011-03-07 17:00:25 +0100
commit9283d7c5c24cb5875f1115117fde2c69ff7735dc (patch)
tree5d4db85d557f4243b5e4933b64ab48d7c4de2b18
parent976ec23da5a335572be9a6130fb4efcc08d62d0e (diff)
downloadbusybox-9283d7c5c24cb5875f1115117fde2c69ff7735dc.zip
busybox-9283d7c5c24cb5875f1115117fde2c69ff7735dc.tar.gz
kill: fix infinite loop when passed PIDs are not valid numbers
Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--procps/kill.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/procps/kill.c b/procps/kill.c
index 3953801..695d266 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -219,6 +219,7 @@ int kill_main(int argc, char **argv)
pid = bb_strtoi(arg, &end, 10);
if (errno && (errno != EINVAL || *end != ' ')) {
bb_error_msg("invalid number '%s'", arg);
+ *end = '\0';
errors++;
} else if (kill(pid, signo) != 0) {
bb_perror_msg("can't kill pid %d", (int)pid);