From: Antony Dovgal Date: Mon, 4 May 2009 14:25:04 +0000 (+0000) Subject: don't segfault on bindto == NULL X-Git-Tag: php-5.4.0alpha1~191^2~3763 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39773487a3ece900445f674b53e7448a4701d425;p=php don't segfault on bindto == NULL --- diff --git a/main/network.c b/main/network.c index 873b464edd..476f930db3 100644 --- a/main/network.c +++ b/main/network.c @@ -792,7 +792,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short switch (sa->sa_family) { #if HAVE_GETADDRINFO && HAVE_IPV6 case AF_INET6: - if (strstr(bindto, ':')) { + if (bindto && strstr(bindto, ':')) { ((struct sockaddr_in6 *)sa)->sin6_family = sa->sa_family; ((struct sockaddr_in6 *)sa)->sin6_port = htons(port); socklen = sizeof(struct sockaddr_in6);