⬢ DragonFlyBSD Kernel Audit
DF-3432 / fix.diff
← back to finding ↓ download raw
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -590,6 +590,11 @@ udp6_connect(netmsg_t msg)
 		goto out;
 	}
 
+	if (nam->sa_len != sizeof(struct sockaddr_in6)) {
+		error = EINVAL;
+		goto out;
+	}
+
 	sin6_p = (struct sockaddr_in6 *)nam;
 	if (IN6_IS_ADDR_V4MAPPED(&sin6_p->sin6_addr)) {
 		error = EADDRNOTAVAIL;