From 192b76c89b2e1bbd6e9cd10cf71641c970f17bdc Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 18 Aug 2020 09:08:03 +0100 Subject: [PATCH] coverity: 62540: explicitly check for NULL even though cannot be --- lib/roles/http/client/client-handshake.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c index 1dabb3da1..8f599efc8 100644 --- a/lib/roles/http/client/client-handshake.c +++ b/lib/roles/http/client/client-handshake.c @@ -995,6 +995,14 @@ solo: ads = wsi->stash->cis[CIS_ADDRESS]; else ads = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_PEER_ADDRESS); + + /* + * Since address must be given at client creation, should not be + * possible, but necessary to satisfy coverity + */ + if (!ads) + return NULL; + #if defined(LWS_WITH_UNIX_SOCK) if (*ads == '+') { wsi->unix_skt = 1;