diff --git a/upnp/src/genlib/miniserver/miniserver.c b/upnp/src/genlib/miniserver/miniserver.c index 80d2877fa..8b228a0dc 100644 --- a/upnp/src/genlib/miniserver/miniserver.c +++ b/upnp/src/genlib/miniserver/miniserver.c @@ -764,7 +764,10 @@ static int init_socket_suff( goto error; break; } - inet_pton(domain, text_addr, addr); + + if (inet_pton(domain, text_addr, addr) <= 0) + goto error; + s->fd = socket(domain, SOCK_STREAM, 0); if (s->fd == INVALID_SOCKET) { strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);