Fix for CVE-2014-0195
[openssl.git] / ssl / d1_both.c
index 1bb2e4d1a131249da700191afa7a0b2a3b2c9859..7de9ae4b5fd86c9533d54183d6c536f5f1d2bf61 100644 (file)
@@ -627,7 +627,16 @@ dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok)
                frag->msg_header.frag_off = 0;
                }
        else
+               {
                frag = (hm_fragment*) item->data;
+               if (frag->msg_header.msg_len != msg_hdr->msg_len)
+                       {
+                       item = NULL;
+                       frag = NULL;
+                       goto err;
+                       }
+               }
+
 
        /* If message is already reassembled, this must be a
         * retransmit and can be dropped.