Don't disable state strings with no-ssl2
[openssl.git] / ssl / d1_both.c
index 820c8f08fa90365faf89e29964c1846ce2cbbee1..51d484d7eaad599870b9146c5e17cdd1a5053821 100644 (file)
@@ -632,7 +632,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.
@@ -1042,6 +1051,8 @@ dtls1_buffer_message(SSL *s, int is_ccs)
        OPENSSL_assert(s->init_off == 0);
 
        frag = dtls1_hm_fragment_new(s->init_num, 0);
+       if (!frag)
+               return 0;
 
        memcpy(frag->fragment, s->init_buf->data, s->init_num);