From: Andy Green Date: Wed, 19 Jul 2017 06:16:32 +0000 (+0800) Subject: coverity 181575: check vhost iface non-null if using via bind_iface X-Git-Tag: upstream/2.3.0~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a4881a14252dc8117cfb228924168b1800e243f;p=platform%2Fupstream%2Flibwebsockets.git coverity 181575: check vhost iface non-null if using via bind_iface --- diff --git a/lib/lws-plat-unix.c b/lib/lws-plat-unix.c index 07b7edc8..28e5bbe4 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) {