From: Pere Orga Date: Mon, 7 Mar 2011 15:22:17 +0000 (+0100) Subject: kill: fix infinite loop when passed PIDs are not valid numbers X-Git-Tag: 1_19_0~239 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9283d7c5c24cb5875f1115117fde2c69ff7735dc;p=oweals%2Fbusybox.git kill: fix infinite loop when passed PIDs are not valid numbers Signed-off-by: Pere Orga Signed-off-by: Denys Vlasenko --- diff --git a/procps/kill.c b/procps/kill.c index 39538016e..695d266c5 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);