From c24384096d5f6c73db1a6756e686622cce276736 Mon Sep 17 00:00:00 2001 From: Maxim Konovalov Date: Fri, 29 Sep 2006 08:00:40 +0000 Subject: [PATCH] o Check for a required "pathname" argument presence. PR: bin/95146 Submitted by: candy-sendpr@kgc.co.jp MFC after: 3 weeks --- sbin/ipfw/ipfw2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 2c12189a69d6..47c4a59005a8 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -5309,6 +5309,8 @@ ipfw_readfile(int ac, char *av[]) */ av += optind - 1; ac -= optind - 1; + if (ac < 2) + errx(EX_USAGE, "no filename argument"); av[ac-1] = NULL; fprintf(stderr, "command is %s\n", av[0]); break;