mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.4'
This commit is contained in:
commit
9709887815
2 changed files with 29 additions and 1 deletions
|
@ -37,7 +37,8 @@
|
||||||
int
|
int
|
||||||
getmbi (int (*getin) (void *in), void *in)
|
getmbi (int (*getin) (void *in), void *in)
|
||||||
{
|
{
|
||||||
int i, mbi = 0;
|
unsigned int mbi = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
27
ext/gd/tests/gh16232.phpt
Normal file
27
ext/gd/tests/gh16232.phpt
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
--TEST--
|
||||||
|
GH-16232 (Overflow on reading wbmp content)
|
||||||
|
--EXTENSIONS--
|
||||||
|
gd
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$good_webp = __DIR__ . '/src.wbmp';
|
||||||
|
$bad_webp = __DIR__ . "/gh16232.webp";
|
||||||
|
copy($good_webp, $bad_webp);
|
||||||
|
var_dump(imagecreatefromwbmp($bad_webp));
|
||||||
|
$data = file_get_contents($bad_webp);
|
||||||
|
$data[3] = chr(-1);
|
||||||
|
file_put_contents($bad_webp, $data);
|
||||||
|
var_dump(imagecreatefromwbmp($bad_webp));
|
||||||
|
$data[3] = chr(1000);
|
||||||
|
file_put_contents($bad_webp, $data);
|
||||||
|
var_dump(imagecreatefromwbmp($bad_webp));
|
||||||
|
unlink($bad_webp);
|
||||||
|
--EXPECTF--
|
||||||
|
object(GdImage)#1 (0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
Warning: imagecreatefromwbmp(): "%s" is not a valid WBMP file in %s on line %d
|
||||||
|
bool(false)
|
||||||
|
|
||||||
|
Warning: imagecreatefromwbmp(): "%s" is not a valid WBMP file in %s on line %d
|
||||||
|
bool(false)
|
Loading…
Add table
Add a link
Reference in a new issue