diff options
author | Andy Green <andy@warmcat.com> | 2021-11-08 09:45:39 +0000 |
---|---|---|
committer | Andy Green <andy@warmcat.com> | 2021-11-08 11:05:28 +0000 |
commit | 39380ffbac0df4af91fe79a2eb51ae86769bdc45 (patch) | |
tree | d403c2b1e49243451dca9dc4eaa48d4c161f4d61 /lib | |
parent | 57c5a0da55d871df6a311ce9f847171995fc29e6 (diff) | |
download | libwebsockets-39380ffbac0df4af91fe79a2eb51ae86769bdc45.tar.gz |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core-net/client/connect.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/core-net/client/connect.c b/lib/core-net/client/connect.c index 89db49d9..23c4c367 100644 --- a/lib/core-net/client/connect.c +++ b/lib/core-net/client/connect.c @@ -451,6 +451,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... */ |