From a0f3cf5cc4a42850b940da33a0b912268286bfd3 Mon Sep 17 00:00:00 2001 From: Jani Taskinen Date: Mon, 20 Apr 2009 17:06:03 +0000 Subject: MFB: Thanks to the "maintainers" who are too lazy to commit FIRST to HEAD! --- ext/mbstring/php_mbregex.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext/mbstring/php_mbregex.c') diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index d868ab3843..67efd96acb 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -718,6 +718,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, MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC); if (re == NULL) { RETVAL_FALSE; -- cgit v1.2.1