From owner-svn-src-head@FreeBSD.ORG Mon Apr 16 07:02:50 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF218106566C; Mon, 16 Apr 2012 07:02:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 69D478FC15; Mon, 16 Apr 2012 07:02:50 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q3G72mvE088053; Mon, 16 Apr 2012 11:02:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q3G72mbW088052; Mon, 16 Apr 2012 11:02:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Apr 2012 11:02:48 +0400 From: Gleb Smirnoff To: Eitan Adler Message-ID: <20120416070248.GQ9391@FreeBSD.org> References: <201204152356.q3FNu4W4007224@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201204152356.q3FNu4W4007224@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r234329 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2012 07:02:51 -0000 On Sun, Apr 15, 2012 at 11:56:04PM +0000, Eitan Adler wrote: E> Author: eadler E> Date: Sun Apr 15 23:56:03 2012 E> New Revision: 234329 E> URL: http://svn.freebsd.org/changeset/base/234329 E> E> Log: E> When searching for uninitialized memory usage add ensure that the entire E> struct is set to zero. E> E> PR: bin/166483 E> Submitted by: Roy Marples E> Reviewed by: delphij E> Approved by: cperciva E> MFC after: 3 days E> E> Modified: E> head/lib/libc/net/if_nametoindex.c E> E> Modified: head/lib/libc/net/if_nametoindex.c E> ============================================================================== E> --- head/lib/libc/net/if_nametoindex.c Sun Apr 15 23:50:13 2012 (r234328) E> +++ head/lib/libc/net/if_nametoindex.c Sun Apr 15 23:56:03 2012 (r234329) E> @@ -70,6 +70,9 @@ if_nametoindex(const char *ifname) E> E> s = _socket(AF_INET, SOCK_DGRAM, 0); E> if (s != -1) { E> +#ifdef PURIFY E> + memset(&ifr, 0, sizeof(ifr)); E> +#endif E> strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); E> if (_ioctl(s, SIOCGIFINDEX, &ifr) != -1) { E> _close(s); Is that PURIFY documented anywhere? -- Totus tuus, Glebius.