]> granicus.if.org Git - php/commitdiff
MF PHP5_3 (fixed #43994)
authorRui Hirokawa <hirokawa@php.net>
Sun, 17 Feb 2008 02:04:12 +0000 (02:04 +0000)
committerRui Hirokawa <hirokawa@php.net>
Sun, 17 Feb 2008 02:04:12 +0000 (02:04 +0000)
ext/mbstring/php_mbregex.c

index 4ad7325bb569963f925213d9acc5728a70f54c8f..0c6b9a97af976bd73aa0a2bc9b8749af0350c312 100644 (file)
@@ -546,6 +546,13 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
                convert_to_string_ex(arg_pattern);
                /* don't bother doing an extended regex with just a number */
        }
+
+       if (!Z_STRVAL_PP(arg_pattern) || Z_STRLEN_PP(arg_pattern) == 0) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "empty pattern");
+               RETVAL_FALSE;
+               goto out;
+       }
+
        re = php_mbregex_compile_pattern(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern), options, MBSTRG(current_mbctype), MBSTRG(regex_default_syntax) TSRMLS_CC);
        if (re == NULL) {
                RETVAL_FALSE;