summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-06-15 14:55:43 +0800
committerXinchen Hui <laruence@gmail.com>2016-06-15 14:55:43 +0800
commit85fd2609167b1b06627ab4385a388b8c86b4c1b3 (patch)
tree212595211d09e5cd7aab1e29daffd908ef28e7a2 /ext/mbstring/php_mbregex.c
parent3389c2e6a6cb2322efb2b16e4d01b5059a857c42 (diff)
parent999a3553d58c537b4919821855b2cc8fb62b0b2f (diff)
downloadphp-git-85fd2609167b1b06627ab4385a388b8c86b4c1b3.tar.gz
Merge branch 'PHP-7.0'
* PHP-7.0: Fixed(attempt to) bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) - oob read access)
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index b49b4e9332..0a3be4c179 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -811,7 +811,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
OnigUChar *pos;
OnigUChar *string_lim;
char *description = NULL;
- char pat_buf[4];
+ char pat_buf[6];
const mbfl_encoding *enc;
@@ -864,6 +864,8 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
pat_buf[1] = '\0';
pat_buf[2] = '\0';
pat_buf[3] = '\0';
+ pat_buf[4] = '\0';
+ pat_buf[5] = '\0';
arg_pattern = pat_buf;
arg_pattern_len = 1;