Fix memory leak from zero-length DTLS fragments.
authorAdam Langley <agl@imperialviolet.org>
Fri, 6 Jun 2014 21:30:33 +0000 (14:30 -0700)
committerJanusz Kozerski <j.kozerski@samsung.com>
Mon, 20 Oct 2014 13:25:32 +0000 (15:25 +0200)
commitd4aa1b8efcda7199be82a498e65f838f294fd345
treecb1614552e3870bb024b72135c05441c41c3002d
parent1c5450d11587589a0cc2c37eccdebdf08b9626b4
Fix memory leak from zero-length DTLS fragments.

The |pqueue_insert| function can fail if one attempts to insert a
duplicate sequence number. When handling a fragment of an out of
sequence message, |dtls1_process_out_of_seq_message| would not call
|dtls1_reassemble_fragment| if the fragment's length was zero. It would
then allocate a fresh fragment and attempt to insert it, but ignore the
return value, leaking the fragment.

This allows an attacker to exhaust the memory of a DTLS peer.

Fixes CVE-2014-3507

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
ssl/d1_both.c