Bug #73479 [Ana->Sus]: Invalid string passed into imagecreatefromstring causes fatal error
| From: | cmb@php.net | Date: | Wed, 09 Nov 2016 17:09:15 +0000 |
| Subject: | Bug #73479 [Ana->Sus]: Invalid string passed into imagecreatefromstring causes fatal error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205263@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: Analyzed
+Status: Suspended
Type: Bug
Package: GD related
Operating System: Ubuntu 14.04
PHP Version: 7.0.12
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I've filed a respective ticket:
<https://github.com/libgd/libgd/issues/338>.
Let's wait how this will be
handled.
Previous Comments:
------------------------------------------------------------------------
[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