[BusyBox-cvs] busybox/procps kill.c,1.50,1.51

Erik Andersen andersen at busybox.net
Wed Aug 6 07:44:01 UTC 2003


Update of /var/cvs/busybox/procps
In directory winder:/tmp/cvs-serv16677/procps

Modified Files:
	kill.c 
Log Message:
Fixup segfault on 'kill -q'


Index: kill.c
===================================================================
RCS file: /var/cvs/busybox/procps/kill.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- kill.c	26 Jul 2003 07:41:56 -0000	1.50
+++ kill.c	6 Aug 2003 07:43:58 -0000	1.51
@@ -32,8 +32,8 @@
 #include <unistd.h>
 #include "busybox.h"
 
-static const int KILL = 0;
-static const int KILLALL = 1;
+#define KILL 0
+#define KILLALL 1
 
 extern int kill_main(int argc, char **argv)
 {
@@ -43,7 +43,7 @@
 
 #ifdef CONFIG_KILLALL
 	/* Figure out what we are trying to do here */
-	whichApp = (strcmp(bb_applet_name, "killall") == 0)? KILLALL : KILL; 
+	whichApp = (strcmp(bb_applet_name, "killall") == 0)? KILLALL : KILL;
 #else
 	whichApp = KILL;
 #endif
@@ -91,7 +91,7 @@
 		quiet++;
 		argv++;
 		argc--;
-		if(argv[1][0] != '-'){
+		if(argc<2 || argv[1][0] != '-'){
 			goto do_it_now;
 		}
 	}
@@ -118,7 +118,7 @@
 			argv++;
 		}
 
-	} 
+	}
 #ifdef CONFIG_KILLALL
 	else {
 		pid_t myPid=getpid();




More information about the busybox-cvs mailing list