Re: com php-src: Fix last invalid read Also revert debugging run-tests.php changes...: run-tests.php sapi/phpdbg/phpdbg_list.c
| From: | Bob Weinand | Date: | Mon, 03 Aug 2015 19:01:52 +0000 |
| Subject: | Re: com php-src: Fix last invalid read Also revert debugging run-tests.php changes...: run-tests.php sapi/phpdbg/phpdbg_list.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-88288@lists.php.net to get a copy of this message | ||
> Am 3.8.2015 um 20:59 schrieb Nuno Lopes <nlopess@php.net>:
>
> Are the changes in the run-tests.php script intentional? If so, can you explain?
> Thanks,
> Nuno
>
> -----Original Message----- From: Bob Weinand
> Sent: Monday, August 03, 2015 7:49 PM
> To: php-cvs@lists.php.net
> Subject: [PHP-CVS] com php-src: Fix last invalid read Also revert debugging run-tests.php
> changes...: run-tests.php sapi/phpdbg/phpdbg_list.c
>
> Commit: b20953118ba41cd9465ccc84e79b6eef3f539573
> Author: Bob Weinand <bobwei9@hotmail.com> Mon, 3 Aug 2015
> 20:49:41 +0200
> Parents: b5e16cebda52b25f651b97c9b9da830ee7e46138
> Branches: master
>
> Link:
>
> http://git.php.net/?p=php-src.git;a=commitdiff;h=b20953118ba41cd9465ccc84e79b6eef3f539573
>
> Log:
> Fix last invalid read
> Also revert debugging run-tests.php changes...
>
> Changed paths:
> M run-tests.php
> M sapi/phpdbg/phpdbg_list.c
>
>
> Diff:
> diff --git a/run-tests.php b/run-tests.php
> index ae39fe4..ba44ce5 100755
> --- a/run-tests.php
> +++ b/run-tests.php
> @@ -1878,7 +1878,7 @@ TEST $file
>
> if (version_compare($valgrind_version, '3.3.0', '>=')) {
> /* valgrind 3.3.0+ doesn't have --log-file-exactly option */
> - $cmd =
> "valgrind -q --tool=memcheck --trace-children=yes --show-leak-kinds=definite,indirect
> --log-file=$memcheck_filename $cmd";
> + $cmd =
> "valgrind -q --tool=memcheck --trace-children=yes --log-file=$memcheck_filename
> $cmd";
> } else {
> $cmd =
> "valgrind -q --tool=memcheck --trace-children=yes --log-file-exactly=$memcheck_filename
> $cmd";
> }
> @@ -1933,7 +1933,7 @@ COMMAND $cmd
> $passed = false;
>
> if ($leak_check) { // leak check
> - $leaked = filesize($memcheck_filename) > 367;
> + $leaked = filesize($memcheck_filename) > 0;
>
> if (!$leaked) {
> @unlink($memcheck_filename);
> diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
> index 89e352a..8369018 100644
> --- a/sapi/phpdbg/phpdbg_list.c
> +++ b/sapi/phpdbg/phpdbg_list.c
> @@ -244,11 +244,11 @@ zend_op_array *phpdbg_compile_file(zend_file_handle
> *file, int type) {
> return NULL;
> }
>
> - data.buf = emalloc(data.len + 1);
> + data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1);
> if (data.len > 0) {
> memcpy(data.buf, bufptr, data.len);
> }
> - data.buf[data.len] = 0;
> + memset(data.buf + data.len, 0, ZEND_MMAP_AHEAD + 1);
> data.filename = filename;
> data.line[0] = 0;
>
Hey,
look at the commit message "revert debugging run-tests changes“ … I accidentally committed
more than I wanted in the previous commit, see http://git.php.net/?p=php-src.git;a=commitdiff;h=b5e16cebda52b25f651b97c9b9da830ee7e46138
<http://git.php.net/?p=php-src.git;a=commitdiff;h=b5e16cebda52b25f651b97c9b9da830ee7e46138>
Bob