summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2015-01-31 21:47:22 -0800
committerStanislav Malyshev <stas@php.net>2015-01-31 21:48:14 -0800
commitaf1f867308ca68e82a2143f62ecd7a6f7b19ba2a (patch)
tree421421ca2b706e063eafdc2f0ea38b0037139bf1 /main
parent882a375dbad4ecb1fddd9dd80f1a1350299629c1 (diff)
parentb30a6d6018705e0a9d345192eba8125ff854c167 (diff)
downloadphp-git-af1f867308ca68e82a2143f62ecd7a6f7b19ba2a.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Use better constant since MAXHOSTNAMELEN may mean shorter name use right sizeof for memset
Diffstat (limited to 'main')
-rw-r--r--main/network.c6
-rw-r--r--main/php_network.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/main/network.c b/main/network.c
index c93e366cc6..636afc62b0 100644
--- a/main/network.c
+++ b/main/network.c
@@ -105,10 +105,6 @@ const struct in6_addr in6addr_any = {0}; /* IN6ADDR_ANY_INIT; */
# define PHP_TIMEOUT_ERROR_VALUE ETIMEDOUT
#endif
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 255
-#endif
-
#if HAVE_GETADDRINFO
#ifdef HAVE_GAI_STRERROR
# define PHP_GAI_STRERROR(x) (gai_strerror(x))
@@ -250,7 +246,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
#else
if (!inet_aton(host, &in)) {
/* XXX NOT THREAD SAFE (is safe under win32) */
- if(strlen(host) > MAXHOSTNAMELEN) {
+ if(strlen(host) > MAXFQDNLEN) {
host_info = NULL;
errno = E2BIG;
} else {
diff --git a/main/php_network.h b/main/php_network.h
index 37ad395af0..8dc4e0aa60 100644
--- a/main/php_network.h
+++ b/main/php_network.h
@@ -313,6 +313,10 @@ END_EXTERN_C()
/* }}} */
+#ifndef MAXFQDNLEN
+#define MAXFQDNLEN 255
+#endif
+
#endif /* _PHP_NETWORK_H */
/*