]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r311233,r311377:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 10 Feb 2017 03:22:00 +0000 (03:22 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 10 Feb 2017 03:22:00 +0000 (03:22 +0000)
commit181958c9d61b8400d33ef5ac3be2240d61e6072d
tree1c7b68d0bc3f0de65c5736a6f3eccea1125a939c
parentca5920c2f15e9d0c0480508face58d5776d7cad0
MFC r311233,r311377:

r311233:

Fix Coverity issues

- Initialize .sun_len before passing it to strlcpy and bind.
- Close fd on error

CID: 978283, 979581

r311377:

Redo fix for CID 979581

The previous change was flawed in terms of how it calculated the
buffer length for the sockaddr_un object. Use SUN_LEN where
appropriate and mute the Coverity complaint by using memset(.., 0, ..)
to zero out the entire structure instead of setting .sun_len to a bogus
value and strlcpy'ing in the contents of argv[1].

SUN_LEN is now being passed to bind(2) as well. For some odd reason
this wasn't flagged as a bug with Coverity.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/netbsd-tests/fs/tmpfs/h_tools.c