From: Jani Taskinen Date: Thu, 16 Aug 2007 23:05:43 +0000 (+0000) Subject: - Check the length too (just like in HEAD) X-Git-Tag: php-5.2.4RC2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb4a23c5ca1945a2ac5283de7d25a5beac352bbb;p=php - Check the length too (just like in HEAD) --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index b6ed033203..b4cf8f1ae1 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4338,7 +4338,8 @@ PHP_FUNCTION(ip2long) /* the only special case when we should return -1 ourselves, * because inet_addr() considers it wrong. */ - if (!memcmp(Z_STRVAL_PP(str), "255.255.255.255", sizeof("255.255.255.255") - 1)) { + if (Z_STRLEN_PP(str) == sizeof("255.255.255.255") - 1 && + !memcmp(Z_STRVAL_PP(str), "255.255.255.255", sizeof("255.255.255.255") - 1)) { RETURN_LONG(-1); }