From owner-svn-src-all@FreeBSD.ORG Wed Dec 17 14:21:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D3731065670; Wed, 17 Dec 2008 14:21:50 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D92E8FC1E; Wed, 17 Dec 2008 14:21:50 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBHELnMo006189; Wed, 17 Dec 2008 14:21:49 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBHELnY6006188; Wed, 17 Dec 2008 14:21:49 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812171421.mBHELnY6006188@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 17 Dec 2008 14:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186226 - stable/6/lib/libc/inet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 14:21:50 -0000 Author: ume Date: Wed Dec 17 14:21:49 2008 New Revision: 186226 URL: http://svn.freebsd.org/changeset/base/186226 Log: MFC 186090 inet_net_pton() can sometimes return the wrong value if excessively large netmasks are supplied. [RT #18512] Reported by: Maksymilian Arciemowicz Obtained from: BIND 9.4.3 Modified: stable/6/lib/libc/inet/inet_net_pton.c (contents, props changed) Modified: stable/6/lib/libc/inet/inet_net_pton.c ============================================================================== --- stable/6/lib/libc/inet/inet_net_pton.c Wed Dec 17 13:13:35 2008 (r186225) +++ stable/6/lib/libc/inet/inet_net_pton.c Wed Dec 17 14:21:49 2008 (r186226) @@ -135,11 +135,11 @@ inet_net_pton_ipv4(const char *src, u_ch assert(n >= 0 && n <= 9); bits *= 10; bits += n; + if (bits > 32) + goto enoent; } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch)); if (ch != '\0') goto enoent; - if (bits > 32) - goto emsgsize; } /* Firey death and destruction unless we prefetched EOS. */