From d623c5c11e09af87e772ff4d3eaee8dc0da6165f Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Thu, 21 Aug 1997 21:34:43 +0000 Subject: [PATCH] Disallow empty arguments (eg: '') as process ids. PR: 2631 Submitted by: Arne Henrik Juul --- bin/kill/kill.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/kill/kill.c b/bin/kill/kill.c index 91493b94c6e0..9ea3cb8fd75f 100644 --- a/bin/kill/kill.c +++ b/bin/kill/kill.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kill.c,v 1.7 1997/06/03 06:24:50 charnier Exp $ + * $Id: kill.c,v 1.8 1997/06/06 06:36:20 charnier Exp $ */ #ifndef lint @@ -78,7 +78,7 @@ main(argc, argv) if (!isdigit(**argv)) usage(); numsig = strtol(*argv, &ep, 10); - if (!*argv || *ep) + if (!**argv || *ep) errx(1, "illegal signal number: %s", *argv); if (numsig >= 128) numsig -= 128; @@ -110,7 +110,7 @@ main(argc, argv) nosig(*argv); } else if (isdigit(**argv)) { numsig = strtol(*argv, &ep, 10); - if (!*argv || *ep) + if (!**argv || *ep) errx(1, "illegal signal number: %s", *argv); if (numsig < 0 || numsig >= NSIG) nosig(*argv); @@ -124,7 +124,7 @@ main(argc, argv) for (errors = 0; argc; argc--, argv++) { pid = strtol(*argv, &ep, 10); - if (!*argv || *ep) { + if (!**argv || *ep) { warnx("illegal process id: %s", *argv); errors = 1; } else if (kill(pid, numsig) == -1) {