From owner-svn-src-head@FreeBSD.ORG Sun Apr 15 23:56:04 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 6E76F1065674; Sun, 15 Apr 2012 23:56:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59F288FC12; Sun, 15 Apr 2012 23:56:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3FNu4WT007226; Sun, 15 Apr 2012 23:56:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3FNu4W4007224; Sun, 15 Apr 2012 23:56:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204152356.q3FNu4W4007224@svn.freebsd.org> From: Eitan Adler Date: Sun, 15 Apr 2012 23:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: 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: Sun, 15 Apr 2012 23:56:04 -0000 Author: eadler Date: Sun Apr 15 23:56:03 2012 New Revision: 234329 URL: http://svn.freebsd.org/changeset/base/234329 Log: When searching for uninitialized memory usage add ensure that the entire struct is set to zero. PR: bin/166483 Submitted by: Roy Marples Reviewed by: delphij Approved by: cperciva MFC after: 3 days Modified: head/lib/libc/net/if_nametoindex.c Modified: head/lib/libc/net/if_nametoindex.c ============================================================================== --- head/lib/libc/net/if_nametoindex.c Sun Apr 15 23:50:13 2012 (r234328) +++ head/lib/libc/net/if_nametoindex.c Sun Apr 15 23:56:03 2012 (r234329) @@ -70,6 +70,9 @@ if_nametoindex(const char *ifname) s = _socket(AF_INET, SOCK_DGRAM, 0); if (s != -1) { +#ifdef PURIFY + memset(&ifr, 0, sizeof(ifr)); +#endif strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (_ioctl(s, SIOCGIFINDEX, &ifr) != -1) { _close(s);