diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 4d8d2d15bacabf1daf4d4b508e6f0ca50c69f6fb..29df26e99a35f054081240dfae844f40e297fd5a 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -776,7 +776,9 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok) /* read the body of the fragment (header has already been read */ i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE, frag->fragment,frag_len,0); - if (i<=0 || (unsigned long)i!=frag_len) + if ((unsigned long)i!=frag_len) + i = -1; + if (i<=0) goto err; }