[git commit master 1/1] kill: fix infinite loop when passed PIDs are not valid numbers

Denys Vlasenko vda.linux at googlemail.com
Mon Mar 7 16:00:25 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=9283d7c5c24cb5875f1115117fde2c69ff7735dc
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Pere Orga <gotrunks at gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 procps/kill.c |    1 +
 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);
-- 
1.7.3.4



More information about the busybox-cvs mailing list