Re: [PHP-CVS] com php-src: These need to be volatile in order to prevent leaking after the longjmp in the error handler: ext/gd/libgd/gd_png.c
On 11/06/2012 12:06 PM, Nuno Lopes wrote: While I won't oppose this patch since it has no performance impact, I believe this is a bug in the compiler and not in the code below. The compiler should know about setjmp(). glibc, for example, marks that function with __attribute__((returns_twice)). Yeah, I don't disagree, but I also don't see a problem with helping the compiler a bit here and it fixes a leak which bit someone badly. -Rasmus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: These need to be volatile in order to prevent leaking after the longjmp in the error handler: ext/gd/libgd/gd_png.c
While I won't oppose this patch since it has no performance impact, I believe this is a bug in the compiler and not in the code below. The compiler should know about setjmp(). glibc, for example, marks that function with __attribute__((returns_twice)). Nuno - Original Message - From: Rasmus Lerdorf ras...@php.net To: php-cvs@lists.php.net Sent: Tuesday, November 06, 2012 4:57 AM Commit:f452b9056e89aa1bf18d6c0828ba709c0f8df854 Author:Rasmus Lerdorf ras...@php.net Mon, 5 Nov 2012 20:56:19 -0800 Parents: 153bfada90b0733943c31e9d7e2bee57c5e7bcac Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f452b9056e89aa1bf18d6c0828ba709c0f8df854 Log: These need to be volatile in order to prevent leaking after the longjmp in the error handler Changed paths: M ext/gd/libgd/gd_png.c Diff: diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c index 49f7cb0..bdbb7ee 100644 --- a/ext/gd/libgd/gd_png.c +++ b/ext/gd/libgd/gd_png.c @@ -127,8 +127,8 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile) png_color_16p trans_gray_rgb; png_color_16p trans_color_rgb; png_bytep trans; - png_bytep image_data = NULL; - png_bytepp row_pointers = NULL; + volatile png_bytep image_data = NULL; + volatile png_bytepp row_pointers = NULL; gdImagePtr im = NULL; int i, j, *open = NULL; volatile int transparent = -1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: These need to be volatile in order to prevent leaking after the longjmp in the error handler: ext/gd/libgd/gd_png.c
Commit:f452b9056e89aa1bf18d6c0828ba709c0f8df854 Author:Rasmus Lerdorf ras...@php.net Mon, 5 Nov 2012 20:56:19 -0800 Parents: 153bfada90b0733943c31e9d7e2bee57c5e7bcac Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f452b9056e89aa1bf18d6c0828ba709c0f8df854 Log: These need to be volatile in order to prevent leaking after the longjmp in the error handler Changed paths: M ext/gd/libgd/gd_png.c Diff: diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c index 49f7cb0..bdbb7ee 100644 --- a/ext/gd/libgd/gd_png.c +++ b/ext/gd/libgd/gd_png.c @@ -127,8 +127,8 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile) png_color_16p trans_gray_rgb; png_color_16p trans_color_rgb; png_bytep trans; - png_bytep image_data = NULL; - png_bytepp row_pointers = NULL; + volatile png_bytep image_data = NULL; + volatile png_bytepp row_pointers = NULL; gdImagePtr im = NULL; int i, j, *open = NULL; volatile int transparent = -1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: These need to be volatile in order to prevent leaking after the longjmp in the error handler: ext/gd/libgd/gd_png.c
Commit:261e32f6236429fcccf61e80262c9df9589d494c Author:Rasmus Lerdorf ras...@php.net Mon, 5 Nov 2012 20:56:19 -0800 Parents: 7bcb8780e0ed042888f88c78919b7726be9ea931 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=261e32f6236429fcccf61e80262c9df9589d494c Log: These need to be volatile in order to prevent leaking after the longjmp in the error handler Changed paths: M ext/gd/libgd/gd_png.c Diff: diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c index 49f7cb0..bdbb7ee 100644 --- a/ext/gd/libgd/gd_png.c +++ b/ext/gd/libgd/gd_png.c @@ -127,8 +127,8 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile) png_color_16p trans_gray_rgb; png_color_16p trans_color_rgb; png_bytep trans; - png_bytep image_data = NULL; - png_bytepp row_pointers = NULL; + volatile png_bytep image_data = NULL; + volatile png_bytepp row_pointers = NULL; gdImagePtr im = NULL; int i, j, *open = NULL; volatile int transparent = -1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: These need to be volatile in order to prevent leaking after the longjmp in the error handler: ext/gd/libgd/gd_png.c
Commit:f8c280d85a3fc5b02e9b19f4e23ddac233abf1e4 Author:Rasmus Lerdorf ras...@php.net Mon, 5 Nov 2012 20:56:19 -0800 Parents: 90bd54c46e0195f65a1a49ac0c01f139915a2dd3 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f8c280d85a3fc5b02e9b19f4e23ddac233abf1e4 Log: These need to be volatile in order to prevent leaking after the longjmp in the error handler Changed paths: M ext/gd/libgd/gd_png.c Diff: diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c index 49f7cb0..bdbb7ee 100644 --- a/ext/gd/libgd/gd_png.c +++ b/ext/gd/libgd/gd_png.c @@ -127,8 +127,8 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile) png_color_16p trans_gray_rgb; png_color_16p trans_color_rgb; png_bytep trans; - png_bytep image_data = NULL; - png_bytepp row_pointers = NULL; + volatile png_bytep image_data = NULL; + volatile png_bytepp row_pointers = NULL; gdImagePtr im = NULL; int i, j, *open = NULL; volatile int transparent = -1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php