]> granicus.if.org Git - php/commitdiff
return false on invalid mode and don't segfault
authorAntony Dovgal <tony2001@php.net>
Wed, 4 Oct 2006 10:52:32 +0000 (10:52 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 4 Oct 2006 10:52:32 +0000 (10:52 +0000)
ext/standard/string.c

index fab460e265478ec455a4336ab3fb99b2109737f9..9ad5f74e1f2b139e17493710bf679fcc207a57d5 100644 (file)
@@ -6465,6 +6465,7 @@ PHP_FUNCTION(count_chars)
                }
                if (UG(unicode) && mode != 1) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only mode=1 is supported with Unicode strings");
+                       RETURN_FALSE;
                }
        }