diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2010-06-27 05:40:50 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2010-06-27 05:40:50 +0000 |
commit | 8eb100c81f1d8479b193b2a578ca0088b69b3ea0 (patch) | |
tree | 0e79a2482bba77c970999fa885235dff0d4ce36f /sbin/iked/ikev2.c | |
parent | a7281d6ce130e719b58589eec602c192037acbfd (diff) |
fix possible double free of the initiator cert
Diffstat (limited to 'sbin/iked/ikev2.c')
-rw-r--r-- | sbin/iked/ikev2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c index 6762d9c6cf0..73eda75d656 100644 --- a/sbin/iked/ikev2.c +++ b/sbin/iked/ikev2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ikev2.c,v 1.19 2010/06/27 01:03:22 reyk Exp $ */ +/* $OpenBSD: ikev2.c,v 1.20 2010/06/27 05:40:49 reyk Exp $ */ /* $vantronix: ikev2.c,v 1.101 2010/06/03 07:57:33 reyk Exp $ */ /* @@ -426,7 +426,7 @@ ikev2_ike_auth(struct iked *env, struct iked_sa *sa, if (msg->msg_cert.id_type) { memcpy(certid, &msg->msg_cert, sizeof(*certid)); - bzero(&msg->msg_id, sizeof(msg->msg_id)); + bzero(&msg->msg_cert, sizeof(msg->msg_cert)); ca_setcert(env, &sa->sa_hdr, id, certid->id_type, @@ -905,6 +905,7 @@ ikev2_policy2id(struct iked_static_id *polid, struct iked_id *id, int srcid) if (gethostname((char *)polid->id_data, sizeof(polid->id_data)) != 0) return (-1); + polid->id_offset = 0; polid->id_length = strlen((char *)polid->id_data); /* excluding NUL */ } |