Re: com php-src: Fixed valgrind issue in mb_ereg_replace_variation1.phpt: ext/mbstring/php_mbregex.c
| From: | Yasuo Ohgaki | Date: | Sat, 31 Jan 2015 02:45:35 +0000 |
| Subject: | Re: com php-src: Fixed valgrind issue in mb_ereg_replace_variation1.phpt: ext/mbstring/php_mbregex.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-84486@lists.php.net to get a copy of this message | ||
Nice catch!
It was made for DBCS at first. I guess that's the reason why.
--
Yasuo Ohgaki
yohgaki@ohgaki.net
On Thu, Jan 29, 2015 at 8:28 PM, Xinchen Hui <laruence@php.net> wrote:
> Commit: 2505aea1535ad2dfd9254939c9c1bbde3085e125
> Author: Xinchen Hui <laruence@php.net> Thu, 29 Jan 2015
> 19:28:46 +0800
> Parents: 7f52978c6727f5bd3452df3b1d684e3708c43833
> Branches: master
>
> Link:
>
> http://git.php.net/?p=php-src.git;a=commitdiff;h=2505aea1535ad2dfd9254939c9c1bbde3085e125
>
> Log:
> Fixed valgrind issue in mb_ereg_replace_variation1.phpt
>
> Changed paths:
> M ext/mbstring/php_mbregex.c
>
>
> Diff:
> diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
> index 59238fd..783a8c9 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;
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>