summaryrefslogtreecommitdiff
path: root/sbin/iked
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2020-03-10 09:35:22 +0000
committertobhe <tobhe@cvs.openbsd.org>2020-03-10 09:35:22 +0000
commit0089e8bc97021a798bb2fdd36f70ecfbc358d109 (patch)
tree66c34305a98d3aa066d099e18a6bb95c32312a9d /sbin/iked
parentfc1834a518ec6fed4ac3adf501399b6c184db031 (diff)
Make sure 'e' is NULL initialized to prevent nullptr dereference in
ibuf_release(). ok gerhard@
Diffstat (limited to 'sbin/iked')
-rw-r--r--sbin/iked/ikev2_msg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/iked/ikev2_msg.c b/sbin/iked/ikev2_msg.c
index 33807b68633..fa253eb520b 100644
--- a/sbin/iked/ikev2_msg.c
+++ b/sbin/iked/ikev2_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2_msg.c,v 1.62 2020/01/22 07:52:37 deraadt Exp $ */
+/* $OpenBSD: ikev2_msg.c,v 1.63 2020/03/10 09:35:21 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -734,7 +734,7 @@ int
ikev2_send_encrypted_fragments(struct iked *env, struct iked_sa *sa,
struct ibuf *in, uint8_t exchange, uint8_t firstpayload, int response) {
struct iked_message resp;
- struct ibuf *buf, *e;
+ struct ibuf *buf, *e = NULL;
struct ike_header *hdr;
struct ikev2_payload *pld;
struct ikev2_frag_payload *frag;
@@ -792,7 +792,7 @@ ikev2_send_encrypted_fragments(struct iked *env, struct iked_sa *sa,
/* Encrypt message and add as an E payload */
data = ibuf_seek(in, offset, 0);
- if((e=ibuf_new(data, MIN(left, max_len))) == NULL) {
+ if ((e = ibuf_new(data, MIN(left, max_len))) == NULL) {
goto done;
}
if ((e = ikev2_msg_encrypt(env, sa, e)) == NULL) {