Re: svn commit: r234329 - head/lib/libc/net
On Sun, Apr 15, 2012 at 11:56:04PM +, 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 r...@marples.name 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. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r234329 - head/lib/libc/net
2012/4/16 Gleb Smirnoff gleb...@freebsd.org: Is that PURIFY documented anywhere? I'm uncertain, but it isn't the only use in the source tree. -- Eitan Adler Source Ports committer X11, Bugbusting teams ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r234329 - head/lib/libc/net
On Mon, Apr 16, 2012 at 11:48:49AM -0400, Eitan Adler wrote: E 2012/4/16 Gleb Smirnoff gleb...@freebsd.org: E Is that PURIFY documented anywhere? E E I'm uncertain, but it isn't the only use in the source tree. Is there any build with it? (rhetoric question) I'm just afraid that committing fix under ifdef won't satisfy submitter of the patch. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r234329 - head/lib/libc/net
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 r...@marples.name 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); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org