Initialize cap_rights before use.

MFC after:	1 week
This commit is contained in:
dchagin 2017-02-18 09:39:20 +00:00
parent bb2f96be46
commit 665056f70d

View File

@ -843,7 +843,8 @@ linux_accept_common(struct thread *td, int s, l_uintptr_t addr,
if (error == EFAULT && namelen != sizeof(struct sockaddr_in))
return (EINVAL);
if (error == EINVAL) {
error1 = getsock_cap(td, s, &rights, &fp, NULL, NULL);
error1 = getsock_cap(td, s,
cap_rights_init(&rights, CAP_ACCEPT), &fp, NULL, NULL);
if (error1 != 0)
return (error1);
so = fp->f_data;