From: namowen Date: Tue, 25 Jul 2017 09:14:37 +0000 (+0800) Subject: client: ipv6 reject when lws_getaddrinfo46 failed X-Git-Tag: accepted/tizen/4.0/unified/20171012.191640~24 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Flibwebsockets.git;a=commitdiff_plain;h=61e58885f48f7519a6a546922f14d8a35be3501e client: ipv6 reject when lws_getaddrinfo46 failed https://github.com/warmcat/libwebsockets/issues/978 --- diff --git a/lib/client-handshake.c b/lib/client-handshake.c index 42d1a9b..6ae27d2 100644 --- a/lib/client-handshake.c +++ b/lib/client-handshake.c @@ -111,6 +111,14 @@ lws_client_connect_2(struct lws *wsi) #ifdef LWS_USE_IPV6 if (wsi->ipv6) { + if (n) { + /* lws_getaddrinfo46 failed, there is no usable result */ + lwsl_notice("%s: lws_getaddrinfo46 failed %d\n", + __func__, n); + cce = "ipv6 lws_getaddrinfo46 failed"; + goto oom4; + } + memset(&sa46, 0, sizeof(sa46)); sa46.sa6.sin6_family = AF_INET6;