Date: Fri, 5 Jan 2007 23:00:43 GMT From: Igor Anishchuk <igor.anishchuk@f-secure.com> To: freebsd-ipfw@FreeBSD.org Subject: Re: kern/107565: [ipfw] [patch] input string parsing mistake Message-ID: <200701052300.l05N0ht1042026@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/107565; it has been noted by GNATS. From: Igor Anishchuk <igor.anishchuk@f-secure.com> To: bug-followup@FreeBSD.org, igor.anishchuk@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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701052300.l05N0ht1042026>