diff --git a/lib/core-net/connect.c b/lib/core-net/connect.c index a2109007b..619240f7b 100644 --- a/lib/core-net/connect.c +++ b/lib/core-net/connect.c @@ -89,7 +89,12 @@ lws_client_connect_via_info(const struct lws_client_connect_info *i) wsi->a.vhost = NULL; if (!i->vhost) { struct lws_vhost *v = i->context->vhost_list; - if (v && !strcmp(v->name, "system")) + + if (!v) { /* coverity */ + lwsl_err("%s: no vhost\n", __func__); + goto bail; + } + if (!strcmp(v->name, "system")) v = v->vhost_next; lws_vhost_bind_wsi(v, wsi); } else diff --git a/lib/system/async-dns/async-dns.c b/lib/system/async-dns/async-dns.c index 8fbd7458a..68faeec4a 100644 --- a/lib/system/async-dns/async-dns.c +++ b/lib/system/async-dns/async-dns.c @@ -298,6 +298,11 @@ lws_async_dns_init(struct lws_context *context) char ads[48]; int n; + if (!context->vhost_list) { /* coverity... system vhost always present */ + lwsl_err("%s: no system vhost\n", __func__); + return 1; + } + memset(&dns->sa46, 0, sizeof(dns->sa46)); #if defined(LWS_WITH_SYS_DHCP_CLIENT)