1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

coverity: COV294450 and COV294451

This commit is contained in:
Andy Green 2020-07-21 08:25:11 +01:00
parent 625bade63e
commit 80ecbb754d
2 changed files with 11 additions and 1 deletions

View file

@ -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

View file

@ -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)