When killall was invoked without arguments, there appeared segmentation fault
author?ukasz Szpakowski <luckboy@vp.pl>
Mon, 22 Sep 2014 13:32:21 +0000 (08:32 -0500)
committer?ukasz Szpakowski <luckboy@vp.pl>
Mon, 22 Sep 2014 13:32:21 +0000 (08:32 -0500)
toys/lsb/killall.c

index e01757a..f3d689b 100644 (file)
@@ -72,7 +72,7 @@ void killall_main(void)
     return;
   }
 
-  if (TT.sig || **TT.names == '-') {
+  if (TT.sig || (*TT.names && **TT.names == '-')) {
     if (0 > (TT.signum = sig_to_num(TT.sig ? TT.sig : (*TT.names)+1))) {
       if (toys.optflags & FLAG_q) exit(1);
       error_exit("Invalid signal");