diff options
-rw-r--r-- | sys/kern/uipc_syscalls.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index b5c500a..2b6599c 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1607,6 +1607,8 @@ getsockaddr(namp, uaddr, len) if (len > SOCK_MAXADDRLEN) return ENAMETOOLONG; + if (len < offsetof(struct sockaddr, sa_data[0])) + return EINVAL; MALLOC(sa, struct sockaddr *, len, M_SONAME, M_WAITOK); error = copyin(uaddr, sa, len); if (error) { |