summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-03-19 13:59:43 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-03-19 13:59:43 +0100
commit2783670daa7831b61937ab91f5d2cd84d63de5fd (patch)
tree091ba417c3c1619080724eeabbe93b00d0ed2902 /ext/pcre/php_pcre.c
parent4fe3d108af2b0a1e8810959fe1ea7a0b52291ad7 (diff)
parent661bce47aebdc67bda1616e1b6979803765173a6 (diff)
downloadphp-git-2783670daa7831b61937ab91f5d2cd84d63de5fd.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 04e5d858c3..37e0b0c68b 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -2500,7 +2500,8 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, zend_string *subject_str,
match_data = pcre2_match_data_create_from_pattern(pce->re, gctx);
if (!match_data) {
PCRE_G(error_code) = PHP_PCRE_INTERNAL_ERROR;
- return;
+ zval_ptr_dtor(return_value);
+ RETURN_FALSE;
}
}
@@ -2620,6 +2621,11 @@ error:
pcre2_match_data_free(match_data);
}
+ if (PCRE_G(error_code) != PHP_PCRE_NO_ERROR) {
+ zval_ptr_dtor(return_value);
+ RETURN_FALSE;
+ }
+
last:
start_offset = (last_match - ZSTR_VAL(subject_str)); /* the offset might have been incremented, but without further successful matches */