Skip to content

Commit 0c37aed

Browse files
committed
Applying same fix as in dtls1_process_out_of_seq_message. A truncated DTLS fragment would cause *ok to be clear, but the return value would still be the number of bytes read.
Problem identified by Emilia Käsper, based on previous issue/patch by Adam Langley. Reviewed-by: Emilia Käsper <emilia@openssl.org>
1 parent 099ccdb commit 0c37aed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ssl/d1_both.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,9 @@ dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok)
663663
/* read the body of the fragment (header has already been read */
664664
i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE,
665665
frag->fragment + msg_hdr->frag_off,frag_len,0);
666-
if (i<=0 || (unsigned long)i!=frag_len)
666+
if ((unsigned long)i!=frag_len)
667+
i=-1;
668+
if (i<=0)
667669
goto err;
668670

669671
RSMBLY_BITMASK_MARK(frag->reassembly, (long)msg_hdr->frag_off,

0 commit comments

Comments
 (0)