]> granicus.if.org Git - php/commitdiff
- Check the length too (just like in HEAD)
authorJani Taskinen <jani@php.net>
Thu, 16 Aug 2007 23:05:43 +0000 (23:05 +0000)
committerJani Taskinen <jani@php.net>
Thu, 16 Aug 2007 23:05:43 +0000 (23:05 +0000)
ext/standard/basic_functions.c

index b6ed033203c361ef56db460388637ff5b38664b1..b4cf8f1ae1cb52f70c6391f30eddb6d5e52d7e2c 100644 (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);
                }