fix #71609: Segmentation fault on ZTS with gethostbyname

This commit is contained in:
Joe Watkins 2016-03-31 12:39:01 +01:00
parent ed06d130f7
commit 233115ea23
10 changed files with 315 additions and 10 deletions

View file

@ -74,6 +74,10 @@ END_EXTERN_C()
#include <sys/socket.h>
#endif
#ifdef HAVE_GETHOSTBYNAME_R
#include <netdb.h>
#endif
/* These are here, rather than with the win32 counterparts above,
* since <sys/socket.h> defines them. */
#ifndef SHUT_RD
@ -309,6 +313,8 @@ PHPAPI void php_network_populate_name_from_sockaddr(
PHPAPI int php_network_parse_network_address_with_port(const char *addr,
zend_long addrlen, struct sockaddr *sa, socklen_t *sl);
PHPAPI struct hostent* php_network_gethostbyname(char *name);
END_EXTERN_C()
#define php_stream_sock_open_from_socket(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_CC)