1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 10:12:18 +01:00

- Check the length too (just like in HEAD)

This commit is contained in:
Jani Taskinen
2007-08-16 23:05:43 +00:00
parent a3e6f47ea1
commit eb4a23c5ca

View File

@@ -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);
}