From owner-freebsd-ipfw@FreeBSD.ORG Fri Jan 5 22:00:40 2007 Return-Path: X-Original-To: freebsd-ipfw@hub.freebsd.org Delivered-To: freebsd-ipfw@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A161F16A407 for ; Fri, 5 Jan 2007 22:00:40 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 93A6613C44C for ; Fri, 5 Jan 2007 22:00:40 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l05M0eoM035772 for ; Fri, 5 Jan 2007 22:00:40 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l05M0eAX035771; Fri, 5 Jan 2007 22:00:40 GMT (envelope-from gnats) Date: Fri, 5 Jan 2007 22:00:40 GMT Message-Id: <200701052200.l05M0eAX035771@freefall.freebsd.org> To: freebsd-ipfw@FreeBSD.org From: Igor Anishchuk Cc: Subject: Re: kern/107565: [ipfw] [patch] input string parsing mistake X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Igor Anishchuk List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2007 22:00:40 -0000 The following reply was made to PR kern/107565; it has been noted by GNATS. From: Igor Anishchuk 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 22:55:46 +0200 Quoted-printable suxx! 3rd turn. Excuse me. Could anybody remove and 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)