Avoid double free when processing DTLS packets.
authorAdam Langley <agl@imperialviolet.org>
Fri, 6 Jun 2014 21:19:21 +0000 (14:19 -0700)
committerMatt Caswell <matt@openssl.org>
Wed, 6 Aug 2014 21:02:00 +0000 (22:02 +0100)
commit1b7024fb69161619855d86b80ae0681ea802e245
tree8788c835c83b52220d2c6d214109112b61371881
parent5021f6314e6486ffe08bfd8c1e075a90528a3d4a
Avoid double free when processing DTLS packets.

The |item| variable, in both of these cases, may contain a pointer to a
|pitem| structure within |s->d1->buffered_messages|. It was being freed
in the error case while still being in |buffered_messages|. When the
error later caused the |SSL*| to be destroyed, the item would be double
freed.

Thanks to Wah-Teh Chang for spotting that the fix in 1632ef74 was
inconsistent with the other error paths (but correct).

Fixes CVE-2014-3505

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