From 9745c5cca8cadcd634bdbf1d12ecc30e75ff405d Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 18 Aug 2020 09:11:45 +0100 Subject: [PATCH] coverity: 62477: explicitly check wsi->protocol even though client creation sets it --- lib/roles/http/client/client-handshake.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c index 8f599efc8..0b1ca96cb 100644 --- a/lib/roles/http/client/client-handshake.c +++ b/lib/roles/http/client/client-handshake.c @@ -145,6 +145,10 @@ lws_client_connect_4_established(struct lws *wsi, struct lws *wsi_piggyback, #endif #endif + /* coverity */ + if (!wsi->a.protocol) + return NULL; + #if defined(LWS_WITH_SOCKS5) if (lwsi_state(wsi) != LRS_ESTABLISHED) switch (lws_socks5c_greet(wsi, &cce)) {