Browse Source
Merge branch 'PHP-7.1'
Merge branch 'PHP-7.1'
* PHP-7.1: Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash Fix #72696: imagefilltoborder stackoverflow on truecolor images Fix #72482: Ilegal write/read access caused by gdImageAALine overflow Fix bug #73144 and bug #73341 - remove extra dtor remove unreferenced var came in with merge Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle Fix #72696: imagefilltoborder stackoverflow on truecolor images Fix #72482: Ilegal write/read access caused by gdImageAALine overflow fix version set versions Fix bug #73144 and bug #73341 - remove extra dtor Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handlepull/2198/head
12 changed files with 133 additions and 73 deletions
-
53ext/gd/libgd/gd.c
-
19ext/gd/tests/bug72482.phpt
-
21ext/gd/tests/bug72482_2.phpt
-
BINext/gd/tests/bug72482_2.png
-
14ext/gd/tests/bug72696.phpt
-
2ext/imap/php_imap.c
-
1ext/pdo/pdo_stmt.c
-
24ext/standard/tests/serialize/bug73341.phpt
-
4ext/wddx/tests/bug45901.phpt
-
2ext/wddx/tests/bug72790.phpt
-
15ext/wddx/tests/bug73331.phpt
-
51ext/wddx/wddx.c
@ -0,0 +1,19 @@ |
|||
--TEST-- |
|||
Bug #72482 (Ilegal write/read access caused by gdImageAALine overflow) |
|||
--SKIPIF-- |
|||
<?php |
|||
if (!extension_loaded('gd')) die('skip gd extension not available'); |
|||
?> |
|||
--FILE-- |
|||
<?php |
|||
$img = imagecreatetruecolor(13, 1007); |
|||
imageantialias($img, true); |
|||
imageline($img, 0, 0, 1073745919, 1073745919, 4096); |
|||
|
|||
$img = imagecreatetruecolor(100, 100); |
|||
imageantialias($img, true); |
|||
imageline($img, 1094795585, 0, 2147483647, 255, 0xff); |
|||
?> |
|||
===DONE=== |
|||
--EXPECT-- |
|||
===DONE=== |
|||
@ -0,0 +1,21 @@ |
|||
--TEST-- |
|||
Bug 72482 (Ilegal write/read access caused by gdImageAALine overflow) |
|||
--SKIPIF-- |
|||
<?php |
|||
if (!extension_loaded('gd')) die('skip gd extension not available'); |
|||
?> |
|||
--FILE-- |
|||
<?php |
|||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc'; |
|||
|
|||
$im = imagecreatetruecolor(10, 10); |
|||
imagefilledrectangle($im, 0, 0, 9, 9, imagecolorallocate($im, 255, 255, 255)); |
|||
imageantialias($im, true); |
|||
imageline($im, 0, 0, 10, 10, imagecolorallocate($im, 0, 0, 0)); |
|||
|
|||
test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'bug72482_2.png', $im); |
|||
?> |
|||
===DONE=== |
|||
--EXPECT-- |
|||
The images are equal. |
|||
===DONE=== |
|||
|
After Width: 10 | Height: 10 | Size: 118 B |
@ -0,0 +1,14 @@ |
|||
--TEST-- |
|||
Bug #72696 (imagefilltoborder stackoverflow on truecolor images) |
|||
--SKIPIF-- |
|||
<?php |
|||
if (!extension_loaded('gd')) die('skip gd extension not available'); |
|||
?> |
|||
--FILE-- |
|||
<?php |
|||
$im = imagecreatetruecolor(10, 10); |
|||
imagefilltoborder($im, 0, 0, 1, -2); |
|||
?> |
|||
===DONE=== |
|||
--EXPECT-- |
|||
===DONE=== |
|||
@ -0,0 +1,24 @@ |
|||
--TEST-- |
|||
Bug #73144 (Use-afte-free in ArrayObject Deserialization) |
|||
--FILE-- |
|||
<?php |
|||
try { |
|||
$token = 'a:2:{i:0;O:1:"0":2:0s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:0x:i:0;r0'; |
|||
$obj = unserialize($token); |
|||
} catch(Exception $e) { |
|||
echo $e->getMessage()."\n"; |
|||
} |
|||
|
|||
try { |
|||
$inner = 'x:i:1;O:8:"stdClass":1:{};m:a:0:{}'; |
|||
$exploit = 'C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}'; |
|||
unserialize($exploit); |
|||
} catch(Exception $e) { |
|||
echo $e->getMessage()."\n"; |
|||
} |
|||
?> |
|||
--EXPECTF-- |
|||
Error at offset 6 of 7 bytes |
|||
|
|||
Notice: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d |
|||
Error at offset 24 of 34 bytes |
|||
@ -0,0 +1,15 @@ |
|||
--TEST-- |
|||
Bug #73331 (NULL Pointer Dereference in WDDX Packet Deserialization with PDORow) |
|||
--SKIPIF-- |
|||
<?php if (!extension_loaded("wddx") || !extension_loaded("pdo")) print "skip"; ?> |
|||
--FILE-- |
|||
<?php |
|||
|
|||
$wddx = "<wddxPacket version='1.0'><header/><data><struct><var name='php_class_name'><string>PDORow</string></var></struct></data></wddxPacket>"; |
|||
var_dump(wddx_deserialize($wddx)); |
|||
?> |
|||
--EXPECTF-- |
|||
|
|||
Warning: wddx_deserialize(): Class pdorow can not be unserialized in %s73331.php on line %d |
|||
NULL |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue