summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2004-12-10 18:50:51 +0000
committermarkus <markus@openbsd.org>2004-12-10 18:50:51 +0000
commita7464cdf8eefa27cb7103bc7a57ba1d94257a99f (patch)
treef5defd2d6d9f16b5ec8c9aeea7585bb5402cc196 /sys
parentfix the Copy-file response handler, it seems the CVS protocol (diff)
downloadwireguard-openbsd-a7464cdf8eefa27cb7103bc7a57ba1d94257a99f.tar.xz
wireguard-openbsd-a7464cdf8eefa27cb7103bc7a57ba1d94257a99f.zip
fix ipsec crash from pr 4025, Stefan Miltchev; ok hshoexer@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pfkeyv2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index dadea771785..2b3e56d64f5 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.95 2004/11/29 21:42:20 hshoexer Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.96 2004/12/10 18:50:51 markus Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -1822,6 +1822,11 @@ pfkeyv2_acquire(struct ipsec_policy *ipo, union sockaddr_union *gw,
if (ipo->ipo_dstid)
i += sizeof(struct sadb_ident) + PADUP(ipo->ipo_dstid->ref_len);
+ if (ipo->ipo_local_cred)
+ i += sizeof(struct sadb_x_cred) + PADUP(ipo->ipo_local_cred->ref_len);
+
+ if (ipo->ipo_local_auth)
+ i += sizeof(struct sadb_x_cred) + PADUP(ipo->ipo_local_auth->ref_len);
/* Allocate */
if (!(p = malloc(i, M_PFKEY, M_DONTWAIT))) {
@@ -2040,7 +2045,7 @@ pfkeyv2_acquire(struct ipsec_policy *ipo, union sockaddr_union *gw,
sadb_comb++;
}
- /* Send the ACQUIRE message to all compliant registered listeners. */
+ /* Send the ACQUIRE message to all compliant registered listeners. */
if ((rval = pfkeyv2_sendmessage(headers,
PFKEYV2_SENDMESSAGE_REGISTERED, NULL, smsg->sadb_msg_satype, 0))
!= 0)