diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-07 09:30:53 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-07 09:30:53 +0000 |
commit | 2280e6505b32f28cd44e31af0bf0fae7e02dab6d (patch) | |
tree | ceafaf2c8e9933772ba4477aff569399c1e23916 /contrib/netbsd-tests/lib/libc/stdlib/t_random.c | |
parent | 06d25691ba0e6a849f0c30e87ca3df000492924c (diff) | |
download | FreeBSD-src-2280e6505b32f28cd44e31af0bf0fae7e02dab6d.zip FreeBSD-src-2280e6505b32f28cd44e31af0bf0fae7e02dab6d.tar.gz |
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.
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/stdlib/t_random.c')
0 files changed, 0 insertions, 0 deletions