diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 820c8f08fa90365faf89e29964c1846ce2cbbee1..228af21462c1812cbe84ed023a5caa181e3dd46a 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -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.