Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2016 20:47:17 -0700
From:      "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To:        Bryan Drewery <bdrewery@FreeBSD.org>
Cc:        Garrett Cooper <ngie@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r300932 - head/usr.sbin/rpcbind
Message-ID:  <7EF99230-228E-49CD-B924-4B594E90ECDF@gmail.com>
In-Reply-To: <7c4e662d-069c-114e-c9d1-320a6571bc89@FreeBSD.org>
References:  <201605290342.u4T3gpUB045575@repo.freebsd.org> <7c4e662d-069c-114e-c9d1-320a6571bc89@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_8EAE00F1-0BE3-435C-87C8-D10F9F9549E8
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On May 28, 2016, at 20:44, Bryan Drewery <bdrewery@FreeBSD.org> wrote:
>=20
> On 5/28/2016 8:42 PM, Garrett Cooper wrote:
>> Author: ngie
>> Date: Sun May 29 03:42:50 2016
>> New Revision: 300932
>> URL: https://svnweb.freebsd.org/changeset/base/300932
>>=20
>> Log:
>>  Catch malloc(3) errors and socket(2) errors
>>=20
>>  - malloc failing will result in a delayed segfault
>>  - socket failing will result in delayed failures with setsockopt
>>=20
>>  Exit in the event that either of these high-level conditions are =
met.
>>=20
>>  Reported by: Coverity
>>  CID: 976288, 976321, 976858
>>  Sponsored by: EMC / Isilon Storage Division
>>=20
>> Modified:
>>  head/usr.sbin/rpcbind/util.c
>>=20
>> Modified: head/usr.sbin/rpcbind/util.c
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/usr.sbin/rpcbind/util.c	Sun May 29 02:59:03 2016	=
(r300931)
>> +++ head/usr.sbin/rpcbind/util.c	Sun May 29 03:42:50 2016	=
(r300932)
>> @@ -336,6 +336,7 @@ network_init(void)
>> 		if (local_in4 =3D=3D NULL) {
>> 			if (debugging)
>> 				fprintf(stderr, "can't alloc local ip4 =
addr\n");
>> +			exit(1);
>> 		}
>> 		memcpy(local_in4, res->ai_addr, sizeof *local_in4);
>> 	}
>> @@ -351,6 +352,7 @@ network_init(void)
>> 		if (local_in6 =3D=3D NULL) {
>> 			if (debugging)
>> 				fprintf(stderr, "can't alloc local ip6 =
addr\n");
>> +			exit(1);
>=20
> Did something meaningful get printed before this on hitting this =
error,
> without debug?

Nope. It just crashed.. I=E2=80=99ve briefly thought about it, and I =
think that err/errx would be better. I=E2=80=99ll run some more =
tests/fix some more Coverity issues in the area, and send it out for CR.
Thanks,
-Ngie

--Apple-Mail=_8EAE00F1-0BE3-435C-87C8-D10F9F9549E8
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJXSmZGAAoJEPWDqSZpMIYVy88QAL934+0lNAnbhPwWWm5YFWoJ
aegRSBIUbPpnQhyklftVNmNq1Z7EuNtb0WYHenNEi7HnPVUoYTf/ZMS3+KK/PUnU
/weB31Evv2yVcRU3pblNiUkahm8kxnRAy/7qHkBTarFPn3oIQ5i8CHRvmo+olhdr
+v7neqz/7bWMn2Cw45aSaAo9RAN0Ew4saeAJwmZlNd4i4ZSwT4b3a/gRtmVLErDZ
PYPDB6ola1m+X0vx6zXYRFKQV1pXWMb+bsT4dPyyO/fmvirHhdaac0IbJxLHDkHC
8VOmORKb52qLpgqp/ZRPPX3Dnq3DpM/sB9P+5Ru/PkpI693H5Qc3YR1St/8j+a+l
7Y6a3OSSbCZs1EK2GDx664WNZi0ZS0Go5tVmpaxiqk6ki/norUkNdIS9gn+7Mgn+
TZRsTN9s8udPGAb576ceuF2f7Txt4IsKvxHwvuDXVA/WHtOdPt8IMGsuT+d24yUM
gWmPi5Ss4TQ6zHCUDP+77tvUUFHhfU5O5cP+VdVagG86crE2pOq1lpQ4wDznt3zM
2gGkQZR3AerfigwW1ARzkbUjxPnCXW1oRJJYvZF1z1Abcp4kWmUibUVgA46np7Ff
14/98UTfOSOePsl61HjyVJLDBP9jQApTjAwfqeI1PR3lmYcGs43lLR6aMos/Sk2r
hC3F23RIii2B0m4gauP4
=413+
-----END PGP SIGNATURE-----

--Apple-Mail=_8EAE00F1-0BE3-435C-87C8-D10F9F9549E8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7EF99230-228E-49CD-B924-4B594E90ECDF>