summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index ecf8183e34..5997d98acc 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -855,7 +855,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
pos = MBSTRG(search_pos);
str = NULL;
len = 0;
- if (Z_TYPE_PP(MBSTRG(search_str)) == IS_STRING){
+ if (MBSTRG(search_str) != NULL && Z_TYPE_PP(MBSTRG(search_str)) == IS_STRING){
str = (unsigned char *)Z_STRVAL_PP(MBSTRG(search_str));
len = Z_STRLEN_PP(MBSTRG(search_str));
}