From 938a48d9b179264ba7c610a750419ce3f830357d Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Thu, 8 Jun 2023 02:37:21 -0600 Subject: [PATCH] sanity check on socket return value for timeout with DTLS13 --- src/internal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/internal.c b/src/internal.c index b675390a1..45124fd64 100644 --- a/src/internal.c +++ b/src/internal.c @@ -10418,6 +10418,9 @@ static int GetDtlsRecordHeader(WOLFSSL* ssl, word32* inOutIdx, * DTLS_RECORD_HEADER_SZ */ if (ssl->buffers.inputBuffer.length - *inOutIdx < DTLS_RECORD_HEADER_SZ) { ret = GetInputData(ssl, DTLS_RECORD_HEADER_SZ); + /* Check if Dtls13RtxTimeout(ssl) returned socket error */ + if (ret == SOCKET_ERROR_E) + return ret; if (ret != 0) return LENGTH_ERROR; }