From cff580b4f0b846cb7c55e80c447a629b814d77c7 Mon Sep 17 00:00:00 2001 From: Marco Oliverio Date: Tue, 14 Feb 2023 12:46:47 +0000 Subject: [PATCH] tests: api: error out on read error in test_server_nofail --- tests/api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/api.c b/tests/api.c index 013ae38c5..4d6a19b41 100644 --- a/tests/api.c +++ b/tests/api.c @@ -5435,6 +5435,9 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_nofail(void* args) input[idx] = '\0'; fprintf(stderr, "Client message: %s\n", input); } + else if (idx < 0) { + goto done; + } if (wolfSSL_write(ssl, msg, sizeof(msg)) != sizeof(msg)) { /*err_sys("SSL_write failed");*/