summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2002-09-25 11:22:36 +0000
committermaxim <maxim@FreeBSD.org>2002-09-25 11:22:36 +0000
commit1a47919de4c42db74ca895ddd0ccb59734cf95e1 (patch)
tree737123b55739ad370320116977900527500d8e1e /sbin/ipfw
parent84c5377d8238867452d66e9a75b9615659e85433 (diff)
downloadFreeBSD-src-1a47919de4c42db74ca895ddd0ccb59734cf95e1.zip
FreeBSD-src-1a47919de4c42db74ca895ddd0ccb59734cf95e1.tar.gz
Do not dump core on 'ipfw add unreach': handling null strings in
fill_reject_code(). Please note ipfw/ipfw2.c is not affected. PR: bin/42304 Submitted by: Andy@wantpackets.com MFC after: 1 day
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c
index 9a87b09..c4f00fd 100644
--- a/sbin/ipfw/ipfw.c
+++ b/sbin/ipfw/ipfw.c
@@ -1063,6 +1063,8 @@ fill_reject_code(u_short *codep, char *str)
u_long val;
char *s;
+ if (str == '\0')
+ errx(EX_DATAERR, "missing unreachable code");
val = strtoul(str, &s, 0);
if (s != str && *s == '\0' && val < 0x100) {
*codep = val;
OpenPOWER on IntegriCloud