From 8a4881a14252dc8117cfb228924168b1800e243f Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 19 Jul 2017 14:16:32 +0800 Subject: [PATCH] coverity 181575: check vhost iface non-null if using via bind_iface --- lib/lws-plat-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lws-plat-unix.c b/lib/lws-plat-unix.c index 07b7edc..28e5bbe 100644 --- a/lib/lws-plat-unix.c +++ b/lib/lws-plat-unix.c @@ -256,7 +256,7 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd) } #if defined(SO_BINDTODEVICE) - if (vhost->bind_iface) { + if (vhost->bind_iface && vhost->iface) { lwsl_info("binding listen skt to %s using SO_BINDTODEVICE\n", vhost->iface); if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, vhost->iface, strlen(vhost->iface)) < 0) { -- 2.7.4