kern/107565: [ipfw] [patch] input string parsing mistake
Igor Anishchuk
igor.anishchuk at f-secure.com
Fri Jan 5 15:00:44 PST 2007
The following reply was made to PR kern/107565; it has been noted by GNATS.
From: Igor Anishchuk <igor.anishchuk at f-secure.com>
To: bug-followup at FreeBSD.org, igor.anishchuk at f-secure.com
Cc:
Subject: Re: kern/107565: [ipfw] [patch] input string parsing mistake
Date: Fri, 5 Jan 2007 23:44:02 +0200
Quoted-printable suxx! 3rd turn. Excuse me. Could anybody remove or edit these messages?
--- /usr/src/sbin/ipfw/ipfw2.c Fri Jan 5 17:43:25 2007
***************
*** 2720,2725 ****
--- 2720,2733 ----
char *p = strpbrk(av, "/:,{");
int masklen;
char md;
+ char t[15];
+ int ti;
+
+ for (ti=0; ti<16 && p && p[ti] != 0; ti++){
+ t[ti]=p[ti+1];
+ if(t[ti] != '.' && (t[ti] < '0' || t[ti] > '9'))
+ t[ti] = '\0';
+ }
if (p) {
md = *p;
***************
*** 2731,2741 ****
errx(EX_NOHOST, "hostname ``%s'' unknown", av);
switch (md) {
case ':':
! if (!inet_aton(p, (struct in_addr *)&d[1]))
errx(EX_DATAERR, "bad netmask ``%s''", p);
break;
case '/':
! masklen = atoi(p);
if (masklen == 0)
d[1] = htonl(0); /* mask */
else if (masklen > 32)
--- 2739,2749 ----
errx(EX_NOHOST, "hostname ``%s'' unknown", av);
switch (md) {
case ':':
! if (!inet_aton(t, (struct in_addr *)&d[1]))
errx(EX_DATAERR, "bad netmask ``%s''", p);
break;
case '/':
! masklen = atoi(t);
if (masklen == 0)
d[1] = htonl(0); /* mask */
else if (masklen > 32)
More information about the freebsd-ipfw
mailing list