coverity 181575: check vhost iface non-null if using via bind_iface

This commit is contained in:
Andy Green 2017-07-19 14:16:32 +08:00
parent 6f11c1361a
commit 8a4881a142

View file

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