Skip to content

Commit 6e14e7f

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 fc15c44 commit 6e14e7f

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
@@ -657,7 +657,9 @@ dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok)
657657
/* read the body of the fragment (header has already been read */
658658
i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE,
659659
frag->fragment + msg_hdr->frag_off,frag_len,0);
660-
if (i<=0 || (unsigned long)i!=frag_len)
660+
if ((unsigned long)i!=frag_len)
661+
i=-1;
662+
if (i<=0)
661663
goto err;
662664

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

0 commit comments

Comments
 (0)