Skip to content

Commit c2a7397

Browse files
authored
Merge pull request #6406 from JacobBarthelmeh/fuzzing
check for socket errors on SendAlert
2 parents c17cff7 + ea40176 commit c2a7397

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/internal.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33327,7 +33327,14 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3332733327
if (ret != 0 || !ssl->options.dtlsStateful) {
3332833328
int alertType = TranslateErrorToAlert(ret);
3332933329
if (alertType != invalid_alert)
33330-
SendAlert(ssl, alert_fatal, alertType);
33330+
if (alertType != invalid_alert) {
33331+
int err;
33332+
33333+
/* propogate socket errors to avoid re-calling send alert */
33334+
err = SendAlert(ssl, alert_fatal, alertType);
33335+
if (err == SOCKET_ERROR_E)
33336+
ret = SOCKET_ERROR_E;
33337+
}
3333133338
*inOutIdx += helloSz;
3333233339
DtlsResetState(ssl);
3333333340
if (DtlsIgnoreError(ret))

0 commit comments

Comments
 (0)