Sec Bug->Bug #76041 [Opn]: null pointer access crashed php
| From: | stas@php.net | Date: | Fri, 02 Mar 2018 06:51:09 +0000 |
| Subject: | Sec Bug->Bug #76041 [Opn]: null pointer access crashed php | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214173@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76041&edit=1
ID: 76041
Updated by: stas@php.net
Reported by: jianjia11010 at hotmail dot com
Summary: null pointer access crashed php
Status: Open
-Type: Security
+Type: Bug
Package: GD related
PHP Version: 7.2.3
Block user comment: N
Private report: Y
Previous Comments:
------------------------------------------------------------------------
[2018-03-02 02:38:32] jianjia11010 at hotmail dot com
Description:
------------
I've tested 7.1.x,7.0.x , it's ok. When php 7.2.x, it crashed.
The problem is when image resource created by imagecreate function which is not truecolor will treat
as truecolor in gdImageSetAAPixelColor function when antialias option is on even
'im->tpixels' is null.
gd.c:1230:gdImageSetAAPixelColor:
im->tpixels[y][x]=gdTrueColorAlpha(dr, dg, db, gdAlphaOpaque);
Test script:
---------------
<?php
$im=imagecreate(100,100);
imageantialias($im,true);
imageline($im,0,0,10,10,0xffffff);
Expected result:
----------------
The php process crashed immediately.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76041&edit=1