]> granicus.if.org Git - php/commitdiff
MFH:- Fix bug #41946 (ip2long("") should return FALSE)
authorJani Taskinen <jani@php.net>
Thu, 16 Aug 2007 22:17:10 +0000 (22:17 +0000)
committerJani Taskinen <jani@php.net>
Thu, 16 Aug 2007 22:17:10 +0000 (22:17 +0000)
ext/standard/basic_functions.c
ext/standard/tests/network/ip.phpt

index 64ebbaad3d0a6372cda3c6de3acc04912c3304ff..b6ed033203c361ef56db460388637ff5b38664b1 100644 (file)
@@ -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);
                }
                
index 794c2d38c980254d354369d77c3beffb495083a6..c7d550fac6601b28f54f2f5200d607f7a45e9ead 100644 (file)
@@ -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)