From d3783f0c71d270898d3f69ea799457bce7c4ad16 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 8 Nov 2021 09:45:39 +0000 Subject: [PATCH] client: connect: confirm we have a protocol Coverity gets antsy that we were checking wsi->a.protocol for NULL earlier then start using it... explicitly bail if it's NULL before we start using it. --- lib/core-net/client/connect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core-net/client/connect.c b/lib/core-net/client/connect.c index 23b8fb1b3..ac44f02dc 100644 --- a/lib/core-net/client/connect.c +++ b/lib/core-net/client/connect.c @@ -450,6 +450,10 @@ lws_client_connect_via_info(const struct lws_client_connect_info *i) if (i->pwsi) *i->pwsi = wsi; + if (!wsi->a.protocol) + /* we must have one protocol or another bound by this point */ + goto bail; + /* PHASE 8: notify protocol with role-specific connected callback */ /* raw socket per se doesn't want this... raw socket proxy wants it... */