aboutsummaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 4b8735fd6671..3c652b9725a1 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -206,6 +206,8 @@ accept1(p, uap, compat)
sizeof (namelen));
if(error)
return (error);
+ if (namelen < 0)
+ return (EINVAL);
}
error = holdsock(fdp, uap->s, &lfp);
if (error)
@@ -1193,6 +1195,10 @@ getsockname1(p, uap, compat)
fdrop(fp, p);
return (error);
}
+ if (len < 0) {
+ fdrop(fp, p);
+ return (EINVAL);
+ }
so = (struct socket *)fp->f_data;
sa = 0;
error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, &sa);
@@ -1272,6 +1278,10 @@ getpeername1(p, uap, compat)
fdrop(fp, p);
return (error);
}
+ if (len < 0) {
+ fdrop(fp, p);
+ return (EINVAL);
+ }
sa = 0;
error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, &sa);
if (error)