diff options
author | Jani Taskinen <jani@php.net> | 2009-04-20 17:06:03 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2009-04-20 17:06:03 +0000 |
commit | a0f3cf5cc4a42850b940da33a0b912268286bfd3 (patch) | |
tree | 17506bf1020a8a4d5fd6ea52fd91feef478a112d /ext/mbstring/php_mbregex.c | |
parent | eae5e432433409514af2c9c477d4b898e8adf86c (diff) | |
download | php-git-a0f3cf5cc4a42850b940da33a0b912268286bfd3.tar.gz |
MFB: Thanks to the "maintainers" who are too lazy to commit FIRST to HEAD!
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r-- | ext/mbstring/php_mbregex.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |