From eb4a23c5ca1945a2ac5283de7d25a5beac352bbb Mon Sep 17 00:00:00 2001 From: Jani Taskinen Date: Thu, 16 Aug 2007 23:05:43 +0000 Subject: [PATCH] - Check the length too (just like in HEAD) --- ext/standard/basic_functions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.50.1