svn commit: r252408 - head/sbin/ifconfig
Ulrich Spörlein
uqs at FreeBSD.org
Wed Jul 3 09:23:10 UTC 2013
On Sun, 2013-06-30 at 07:37:32 +0000, Hiroki Sato wrote:
> Author: hrs
> Date: Sun Jun 30 07:37:31 2013
> New Revision: 252408
> URL: http://svnweb.freebsd.org/changeset/base/252408
>
> Log:
> Do not display a warning message in a jail without AF_INET6 support.
>
> MFC after: 3 days
>
> Modified:
> head/sbin/ifconfig/af_nd6.c
>
> Modified: head/sbin/ifconfig/af_nd6.c
> ==============================================================================
> --- head/sbin/ifconfig/af_nd6.c Sun Jun 30 06:44:31 2013 (r252407)
> +++ head/sbin/ifconfig/af_nd6.c Sun Jun 30 07:37:31 2013 (r252408)
> @@ -148,7 +148,7 @@ nd6_status(int s)
> memset(&nd, 0, sizeof(nd));
> strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname));
> if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
> - if (errno != EAFNOSUPPORT)
> + if (errno != EAFNOSUPPORT && error != EPROTONOSUPPORT)
> warn("socket(AF_INET6, SOCK_DGRAM)");
> return;
> }
This gives undefined behavior, error is uninitialized at this point.
Found by: Coverity Scan, CID 1042128
Cheers,
Uli
More information about the svn-src-all
mailing list