From 9283d7c5c24cb5875f1115117fde2c69ff7735dc Mon Sep 17 00:00:00 2001 From: Pere Orga Date: Mon, 7 Mar 2011 16:22:17 +0100 Subject: [PATCH] kill: fix infinite loop when passed PIDs are not valid numbers Signed-off-by: Pere Orga Signed-off-by: Denys Vlasenko --- procps/kill.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.25.1