Skip to content

Commit

Permalink
Follow on from CVE-2014-3571. This fixes the code that was the origin…
Browse files Browse the repository at this point in the history
…al source

of the crash due to p being NULL. Steve's fix prevents this situation from
occuring - however this is by no means obvious by looking at the code for
dtls1_get_record. This fix just makes things look a bit more sane.

Reviewed-by: Dr Steve Henson <steve@openssl.org>
  • Loading branch information
mattcaswell committed Jan 8, 2015
1 parent 8d7aab9 commit 45fe66b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ssl/d1_pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,8 @@ int dtls1_get_record(SSL *s)
* would be dropped unnecessarily.
*/
if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE &&
*p == SSL3_MT_CLIENT_HELLO) &&
s->packet_length > DTLS1_RT_HEADER_LENGTH &&
s->packet[DTLS1_RT_HEADER_LENGTH] == SSL3_MT_CLIENT_HELLO) &&
!dtls1_record_replay_check(s, bitmap))
{
rr->length = 0;
Expand Down

0 comments on commit 45fe66b

Please sign in to comment.