From: Rui Hirokawa Date: Sun, 17 Feb 2008 02:04:12 +0000 (+0000) Subject: MF PHP5_3 (fixed #43994) X-Git-Tag: php-5.2.6RC1~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=419b7283d336ebcbd40423d7e8105d3bc339c114;p=php MF PHP5_3 (fixed #43994) --- diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 4ad7325bb5..0c6b9a97af 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -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;