Bug #73479 [Sus->Csd]: Invalid string passed into imagecreatefromstring causes fatal error
| From: | cmb@php.net | Date: | Wed, 30 Aug 2017 12:09:16 +0000 |
| Subject: | Bug #73479 [Sus->Csd]: Invalid string passed into imagecreatefromstring causes fatal error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210876@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73479&edit=1
ID: 73479
Updated by: cmb@php.net
Reported by: dougnelson at silktide dot com
Summary: Invalid string passed into imagecreatefromstring
causes fatal error
-Status: Suspended
+Status: Closed
Type: Bug
Package: GD related
Operating System: Ubuntu 14.04
PHP Version: 7.0.12
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This issue is supposed to be solved by libgd 2.2.5 which just has
been released. Therefore I'm closing this ticket.
Previous Comments:
------------------------------------------------------------------------
[2017-01-24 13:22:26] cmb@php.net
Related To: Bug #73986
------------------------------------------------------------------------
[2016-11-14 15:43:51] cmb@php.net
Related To: Bug #73514
------------------------------------------------------------------------
[2016-11-09 17:09:14] cmb@php.net
I've filed a respective ticket:
<https://github.com/libgd/libgd/issues/338>.
Let's wait how this will be
handled.
------------------------------------------------------------------------
[2016-11-09 17:00:34] cmb@php.net
I can confirm this issue.
It seems to me that should be addressed in libgd[1],
where libgd raises a GD_ERROR in case an "unrecoverable" error is
detected, but nonetheless is able to resume; note that if libgd can't
resume, also a GD_ERROR is raised, but exit() is called immediately
afterwards.
[1] <https://github.com/libgd/libgd/blob/gd-2.2.3/src/gd_jpeg.c#L100-L119>
------------------------------------------------------------------------
[2016-11-08 17:28:44] dougnelson at silktide dot com
Description:
------------
Using:
gd
GD Support => enabled
GD Version => bundled (2.1.0 compatible)
Running the below test code that attempts to create a JPG using imagecreatefromstring will cause a
E_WARNING, but not a fatal error.
Using:
gd
GD Support => enabled
GD headers Version => 2.2.3
GD library Version => 2.2.3
To run the same test code cases a fatal exception that is unable to be caught.
Test script:
---------------
http://pastebin.com/cgBkb6Cz
Expected result:
----------------
An E_WARNING warning of the same.
Actual result:
--------------
PHP Fatal error: imagecreatefromstring(): gd-jpeg: JPEG library reports unrecoverable error:
Invalid JPEG file structure: SOS before SOF in /tmp/foo.php on line 7
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73479&edit=1