From 5fe9335b366a5e442fb1e4d74646241036cfc1d4 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 19 Mar 2018 19:20:29 +0800 Subject: [PATCH] coverity 188416: possibility of NULL iface --- lib/libwebsockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 997c103b..c087c070 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -2373,6 +2373,8 @@ lws_socket_bind(struct lws_vhost *vhost, lws_sockfd_type sockfd, int port, n = sizeof(struct sockaddr_un); bzero((char *) &serv_unix, sizeof(serv_unix)); serv_unix.sun_family = AF_UNIX; + if (!iface) + return -1; if (sizeof(serv_unix.sun_path) <= strlen(iface)) { lwsl_err("\"%s\" too long for UNIX domain socket\n", iface);