summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2004-03-29 16:32:19 +0000
committerderaadt <deraadt@openbsd.org>2004-03-29 16:32:19 +0000
commitb6cbd56e07ab4153cf0289ac8311d6f998b0e88e (patch)
treee760614cf0456cb7119c4bd811fd2261f30a0433
parentRevise for OpenBSD 3.5 and mentio bsd.rd-a.out; OK deraadt@ (diff)
downloadwireguard-openbsd-b6cbd56e07ab4153cf0289ac8311d6f998b0e88e.tar.xz
wireguard-openbsd-b6cbd56e07ab4153cf0289ac8311d6f998b0e88e.zip
memory mishandling; from ho
-rw-r--r--sbin/isakmpd/udp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/isakmpd/udp.c b/sbin/isakmpd/udp.c
index 3de891d4111..097a8412737 100644
--- a/sbin/isakmpd/udp.c
+++ b/sbin/isakmpd/udp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp.c,v 1.66 2004/03/19 14:04:43 hshoexer Exp $ */
+/* $OpenBSD: udp.c,v 1.67 2004/03/29 16:32:19 deraadt Exp $ */
/* $EOM: udp.c,v 1.57 2001/01/26 10:09:57 niklas Exp $ */
/*
@@ -343,7 +343,9 @@ udp_bind_if (char *ifname, struct sockaddr *if_addr, void *arg)
* address bound. If so, unmark the transport and skip it; this allows
* us to call this function when we suspect a new address has appeared.
*/
- memcpy (saddr, if_addr, sizeof saddr_st);
+ if (sysdep_sa_len (if_addr) > sizeof saddr_st)
+ return 0;
+ memcpy (saddr, if_addr, sysdep_sa_len (if_addr));
switch (saddr->sa_family) /* Add the port number to the sockaddr. */
{
case AF_INET: