summaryrefslogtreecommitdiff
path: root/ext/mbstring
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-01-29 19:28:46 +0800
committerXinchen Hui <laruence@php.net>2015-01-29 19:28:46 +0800
commit2505aea1535ad2dfd9254939c9c1bbde3085e125 (patch)
tree3cbc95ce5e6886b884bad7375409c99e40a51780 /ext/mbstring
parent7f52978c6727f5bd3452df3b1d684e3708c43833 (diff)
downloadphp-git-2505aea1535ad2dfd9254939c9c1bbde3085e125.tar.gz
Fixed valgrind issue in mb_ereg_replace_variation1.phpt
Diffstat (limited to 'ext/mbstring')
-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 59238fda39..783a8c98a5 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -810,7 +810,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
OnigUChar *pos;
OnigUChar *string_lim;
char *description = NULL;
- char pat_buf[2];
+ char pat_buf[4];
const mbfl_encoding *enc;
@@ -861,6 +861,8 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
convert_to_long_ex(arg_pattern_zval);
pat_buf[0] = (char)Z_LVAL_P(arg_pattern_zval);
pat_buf[1] = '\0';
+ pat_buf[2] = '\0';
+ pat_buf[3] = '\0';
arg_pattern = pat_buf;
arg_pattern_len = 1;