1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.4'

This commit is contained in:
David Carlier
2024-10-05 11:35:57 +01:00
2 changed files with 29 additions and 1 deletions

View File

@@ -37,7 +37,8 @@
int
getmbi (int (*getin) (void *in), void *in)
{
int i, mbi = 0;
unsigned int mbi = 0;
int i;
do
{

27
ext/gd/tests/gh16232.phpt Normal file
View 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)