changeset 1498:d965dfbee154

When killall was invoked without arguments, there appeared segmentation fault
author ?ukasz Szpakowski <luckboy@vp.pl>
date Mon, 22 Sep 2014 08:32:21 -0500
parents f64ca21ed444
children 319e79bab052
files toys/lsb/killall.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/toys/lsb/killall.c	Mon Sep 22 08:22:12 2014 -0500
+++ b/toys/lsb/killall.c	Mon Sep 22 08:32:21 2014 -0500
@@ -72,7 +72,7 @@
     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");