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
[-- Attachment #1 --] > On May 28, 2016, at 20:44, Bryan Drewery <bdrewery@FreeBSD.org> wrote: > > 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 >> >> Log: >> Catch malloc(3) errors and socket(2) errors >> >> - malloc failing will result in a delayed segfault >> - socket failing will result in delayed failures with setsockopt >> >> Exit in the event that either of these high-level conditions are met. >> >> Reported by: Coverity >> CID: 976288, 976321, 976858 >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/usr.sbin/rpcbind/util.c >> >> Modified: head/usr.sbin/rpcbind/util.c >> ============================================================================== >> --- 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 == 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 == NULL) { >> if (debugging) >> fprintf(stderr, "can't alloc local ip6 addr\n"); >> + exit(1); > > Did something meaningful get printed before this on hitting this error, > without debug? Nope. It just crashed.. I’ve briefly thought about it, and I think that err/errx would be better. I’ll run some more tests/fix some more Coverity issues in the area, and send it out for CR. Thanks, -Ngie [-- Attachment #2 --] -----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-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7EF99230-228E-49CD-B924-4B594E90ECDF>
