Re: com php-src: Fix bug #71952: Corruption inside imageaffinematrixget: NEWS ext/gd/gd.c ext/gd/tests/bug71952.phpt
| From: | Matteo Beccati | Date: | Tue, 19 Apr 2016 11:47:29 +0000 |
| Subject: | Re: com php-src: Fix bug #71952: Corruption inside imageaffinematrixget: NEWS ext/gd/gd.c ext/gd/tests/bug71952.phpt | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-91791@lists.php.net to get a copy of this message | ||
Hi Stas,
I'm getting a memleak / failure:
https://revive.beccati.com/bamboo/browse/PHP-SRC2-TESTS-713/test/case/30048264
FAILED:
002+ [Tue Apr 19 13:07:08 2016] Script: 'ext/gd/tests/bug71952.php'
003+ ext/gd/gd.c(5367) : Freeing 0x7F27DAC15D50 (32 bytes),
script=ext/gd/tests/bug71952.php
004+ === Total 1 memory leaks detected ===
Cheers
On 19/04/2016 08:33, Stanislav Malyshev wrote:
> Commit: f061867fd385109861d128ae6f3e2484fc4daa72
> Author: Stanislav Malyshev <stas@php.net> Mon, 18 Apr 2016 23:31:03 -0700
> Parents: ffc697ac27377df3f295c7dc7281b578759645cb
> Branches: PHP-5.6
>
> Link:
> http://git.php.net/?p=php-src.git;a=commitdiff;h=f061867fd385109861d128ae6f3e2484fc4daa72
>
> Log:
> Fix bug #71952: Corruption inside imageaffinematrixget
>
> Bugs:
> https://bugs.php.net/71952
>
> Changed paths:
> M NEWS
> M ext/gd/gd.c
> A ext/gd/tests/bug71952.phpt
>
>
> Diff:
> diff --git a/NEWS b/NEWS
> index dbc0f73..58b8631 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -16,6 +16,9 @@ PHP
> NEWS
> - Date:
> . Fixed bug #71889 (DateInterval::format Segmentation fault). (Thomas Punt)
>
> +- GD:
> + . Fixed bug #71952 (Corruption inside imageaffinematrixget). (Stas)
> +
> - OCI8:
> . Fixed bug #71422 (Fix ORA-01438: value larger than specified precision
> allowed for this column). (Chris Jones)
> diff --git a/ext/gd/gd.c b/ext/gd/gd.c
> index b7203e7..df0a32f 100644
> --- a/ext/gd/gd.c
> +++ b/ext/gd/gd.c
> @@ -5362,7 +5362,10 @@ PHP_FUNCTION(imageaffinematrixget)
> php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number is expected as option");
> RETURN_FALSE;
> }
> - convert_to_double_ex(&options);
> + if(Z_TYPE_P(options) != IS_DOUBLE) {
> + Z_ADDREF_P(options);
> + convert_to_double_ex(&options);
> + }
> angle = Z_DVAL_P(options);
>
> if (type == GD_AFFINE_SHEAR_HORIZONTAL) {
> diff --git a/ext/gd/tests/bug71952.phpt b/ext/gd/tests/bug71952.phpt
> new file mode 100644
> index 0000000..f1f66bf
> --- /dev/null
> +++ b/ext/gd/tests/bug71952.phpt
> @@ -0,0 +1,14 @@
> +--TEST--
> +Bug #71952 (Corruption inside imageaffinematrixget)
> +--SKIPIF--
> +<?php
> + if(!extension_loaded('gd')){ die('skip gd extension not available'); }
> +?>
> +--FILE--
> +<?php
> +$vals=[str_repeat("A","200"),0,1,2,3,4,5,6,7,8,9];
> +imageaffinematrixget(4,$vals[0]);
> +var_dump($vals[0]);
> +?>
> +--EXPECTF--
> +string(200)
> "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
> \ No newline at end of file
>
>
--
Matteo Beccati
Development & Consulting - http://www.beccati.com/