[PATCH] wolfssl: treat !data->in_data as a WANT_READ
Juliusz Sosinowicz
juliusz at wolfssl.com
Fri Jul 18 05:20:02 PDT 2025
When !data->in_data then wpabuf_len(data->in_data) will result in a segfault as wpabuf_len does not have a NULL check inside
Signed-off-by: Juliusz Sosinowicz <juliusz at wolfssl.com>
---
src/crypto/tls_wolfssl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/crypto/tls_wolfssl.c b/src/crypto/tls_wolfssl.c
index c6a801a2e5..f9929a1205 100644
--- a/src/crypto/tls_wolfssl.c
+++ b/src/crypto/tls_wolfssl.c
@@ -167,6 +167,9 @@ static int wolfssl_receive_cb(WOLFSSL *ssl, char *buf, int sz, void *ctx)
if (!data)
return -1;
+ if (!data->in_data)
+ return -2; /* WANT_READ */
+
if (get > (wpabuf_len(data->in_data) - data->consumed))
get = wpabuf_len(data->in_data) - data->consumed;
--
2.43.0
More information about the Hostap
mailing list