From a3e6f47ea110bdd303588b16c76fe83940dc991a Mon Sep 17 00:00:00 2001 From: Jani Taskinen Date: Thu, 16 Aug 2007 22:17:10 +0000 Subject: [PATCH] MFH:- Fix bug #41946 (ip2long("") should return FALSE) --- ext/standard/basic_functions.c | 2 +- ext/standard/tests/network/ip.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 64ebbaad3d..b6ed033203 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4338,7 +4338,7 @@ 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", Z_STRLEN_PP(str))) { + if (!memcmp(Z_STRVAL_PP(str), "255.255.255.255", sizeof("255.255.255.255") - 1)) { RETURN_LONG(-1); } diff --git a/ext/standard/tests/network/ip.phpt b/ext/standard/tests/network/ip.phpt index 794c2d38c9..c7d550fac6 100644 --- a/ext/standard/tests/network/ip.phpt +++ b/ext/standard/tests/network/ip.phpt @@ -50,7 +50,7 @@ string(14) "66.163.161.116" Warning: Wrong parameter count for ip2long() in %s on line %d NULL -int(-1) +bool(false) bool(false) int(1869573999) -- 2.50.1