From e3f895a71d804a12456d10c4604df3943a065d34 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 13 Jul 2019 11:59:05 -0700 Subject: [PATCH] COVA11626: pwsi is not allowed to be NULL --- lib/roles/http/client/client-handshake.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c index 5d230b10c..8a5c6a709 100644 --- a/lib/roles/http/client/client-handshake.c +++ b/lib/roles/http/client/client-handshake.c @@ -789,7 +789,12 @@ lws_client_reset(struct lws **pwsi, int ssl, const char *address, int port, { char origin[300] = "", protocol[300] = "", method[32] = "", iface[16] = "", alpn[32] = "", *p; - struct lws *wsi = *pwsi; + struct lws *wsi; + + if (!pwsi) + return NULL; + + wsi = *pwsi; if (wsi->redirects == 3) { lwsl_err("%s: Too many redirects\n", __func__);