Skip to content

Commit d315265

Browse files
committed
Unnecessary recursion when receiving a DTLS hello request can be used to crash a DTLS client. Fixed by handling DTLS hello request without recursion. Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue.
1 parent 006cd70 commit d315265

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ssl/d1_both.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
793793
int i,al;
794794
struct hm_header_st msg_hdr;
795795

796+
redo:
796797
/* see if we have the required fragment already */
797798
if ((frag_len = dtls1_retrieve_buffered_fragment(s,max,ok)) || *ok)
798799
{
@@ -851,8 +852,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
851852
s->msg_callback_arg);
852853

853854
s->init_num = 0;
854-
return dtls1_get_message_fragment(s, st1, stn,
855-
max, ok);
855+
goto redo;
856856
}
857857
else /* Incorrectly formated Hello request */
858858
{

0 commit comments

Comments
 (0)