windows: WCHAR in lws_plat_inet_ntop needs double the final allocation
authorAndy Green <andy@warmcat.com>
Mon, 5 Sep 2016 07:03:37 +0000 (15:03 +0800)
committerAndy Green <andy@warmcat.com>
Mon, 5 Sep 2016 07:03:37 +0000 (15:03 +0800)
https://github.com/warmcat/libwebsockets/issues/619

lib/lws-plat-win.c

index cdf37e9..a7e285e 100644 (file)
@@ -468,7 +468,7 @@ lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt)
        DWORD bufferlen = cnt;
        BOOL ok = FALSE;
 
-       buffer = lws_malloc(bufferlen);
+       buffer = lws_malloc(bufferlen * 2);
        if (!buffer) {
                lwsl_err("Out of memory\n");
                return NULL;