summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2014-10-22 15:29:31 +0000
committerjsing <>2014-10-22 15:29:31 +0000
commitc2e047559db4077d59c47364a006d7b0e33bde76 (patch)
treeda946aaf9f31b1dc29c2b8cb33c8e544f761c500
parent5746ae595318fcc502641bd37fd223911482aa77 (diff)
downloadopenbsd-c2e047559db4077d59c47364a006d7b0e33bde76.tar.gz
openbsd-c2e047559db4077d59c47364a006d7b0e33bde76.tar.bz2
openbsd-c2e047559db4077d59c47364a006d7b0e33bde76.zip
Avoid a NULL pointer dereference that can be triggered by
SSL3_RT_HANDSHAKE replays. Reported by Markus Stenberg <markus.stenberg at iki.fi> - thanks! ok deraadt@
-rw-r--r--src/lib/libssl/d1_pkt.c4
-rw-r--r--src/lib/libssl/src/ssl/d1_pkt.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index 6f3ee26217..7aa5aac752 100644
--- a/src/lib/libssl/d1_pkt.c
+++ b/src/lib/libssl/d1_pkt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_pkt.c,v 1.35 2014/10/18 16:13:16 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.36 2014/10/22 15:29:31 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -586,7 +586,7 @@ again:
586 * would be dropped unnecessarily. 586 * would be dropped unnecessarily.
587 */ 587 */
588 if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE && 588 if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE &&
589 *p == SSL3_MT_CLIENT_HELLO) && 589 p != NULL && *p == SSL3_MT_CLIENT_HELLO) &&
590 !dtls1_record_replay_check(s, bitmap)) { 590 !dtls1_record_replay_check(s, bitmap)) {
591 rr->length = 0; 591 rr->length = 0;
592 s->packet_length=0; /* dump this record */ 592 s->packet_length=0; /* dump this record */
diff --git a/src/lib/libssl/src/ssl/d1_pkt.c b/src/lib/libssl/src/ssl/d1_pkt.c
index 6f3ee26217..7aa5aac752 100644
--- a/src/lib/libssl/src/ssl/d1_pkt.c
+++ b/src/lib/libssl/src/ssl/d1_pkt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_pkt.c,v 1.35 2014/10/18 16:13:16 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.36 2014/10/22 15:29:31 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -586,7 +586,7 @@ again:
586 * would be dropped unnecessarily. 586 * would be dropped unnecessarily.
587 */ 587 */
588 if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE && 588 if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE &&
589 *p == SSL3_MT_CLIENT_HELLO) && 589 p != NULL && *p == SSL3_MT_CLIENT_HELLO) &&
590 !dtls1_record_replay_check(s, bitmap)) { 590 !dtls1_record_replay_check(s, bitmap)) {
591 rr->length = 0; 591 rr->length = 0;
592 s->packet_length=0; /* dump this record */ 592 s->packet_length=0; /* dump this record */