summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorRui Hirokawa <hirokawa@php.net>2008-02-17 02:04:12 +0000
committerRui Hirokawa <hirokawa@php.net>2008-02-17 02:04:12 +0000
commit419b7283d336ebcbd40423d7e8105d3bc339c114 (patch)
tree4e1d4a3ec51808b917c538a1f83988685d120ada /ext/mbstring/php_mbregex.c
parente2fa604b0a5e79c04c1d0a9ecaf43dab62007067 (diff)
downloadphp-git-419b7283d336ebcbd40423d7e8105d3bc339c114.tar.gz
MF PHP5_3 (fixed #43994)
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c7
1 files changed, 7 insertions, 0 deletions
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;