BMP width above INT_MAX is published as a negative HTML attribute
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza por el análisis del ancho de BMP en ext/standard/image.c alrededor de la línea 127 y el formateador compartido alrededor de la línea 1594; después, revisa las pruebas de tamaño de imagen cercanas para encontrar el archivo de prueba pertinente. Rechaza un ancho de BMP superior a INT_MAX para que getimagesizefromstring() devuelva false para la imagen malformada proporcionada, y ejecuta la prueba específica para confirmarlo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
The following code:
<?php
$bmp = 'BM' . pack('VVV', 54, 0, 54)
. pack('VVV', 40, 0x80000001, 1)
. pack('vv', 1, 24)
. str_repeat("\0", 24);
var_dump(getimagesizefromstring($bmp));
Resulted in this output:
array(8) {
[0]=>
int(2147483649)
[1]=>
int(1)
[2]=>
int(6)
[3]=>
string(30) "width="-2147483647" height="1""
["bits"]=>
int(24)
["mime"]=>
string(9) "image/bmp"
["width_unit"]=>
string(2) "px"
["height_unit"]=>
string(2) "px"
}
But I expected this output instead:
bool(false)
ext/standard/image.c:127 assembles the signed BMP biWidth bytes directly into unsigned result->width without rejecting values above INT_MAX, and the shared formatter at image.c:1594 prints that unsigned value with %d. The malformed width must be rejected instead of being returned as 2147483649 and rendered as -2147483647.
PHP Version
PHP 8.7.0-dev (cli) (built: Nov 29 2026 03:42:09) (NTS)
Copyright © The PHP Group and Contributors
Zend Engine v4.7.0-dev, Copyright © Zend by Perforce
with Zend OPcache v8.7.0-dev, Copyright ©, by Zend by Perforce
Operating System
Ubuntu 24.04.5 LTS
- Lenguaje dominante
- C
- Estrellas
- 41.9k
- Forks
- 8.5k
- Merge medio
- 2 d 16 h
- PR fusionados (30 d)
- 116
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de php/php-src
-
SessionInterfaceHandler is throwing a deprecation notice as a warning instead of a deprecationAbiertoBug Status: Needs Triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
getimagesize(): WebP VP8 dimensions are accepted with an invalid start codePosiblemente ocupada @lazerg la tomó hoy. AbiertoBug Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Bug Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
php/php-src#25962 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Bug Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Bug Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
Todos los issues de php/php-src
Issues similares
-
RecompLauncher supportAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
shinyquagsire23/OpenJKDF2#540 ·
Los mantenedores suelen responder en 12 días
-
Prison work hall: laundry and kitchen stations stand at bare walls, the hatch has no counter or signAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Life-Framework/Life-Framework#5939 ·
Los mantenedores suelen responder en 1 día
-
autoconf failes to find libsodium even when present due to implicit function declarationPosiblemente ocupada @coderjoe la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 13 días
-
enhancement_package: a site operand of another JSON type raises TypeError, not a named refusalAbiertobug python
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
Jstar269/nakagawa-recomp#3521 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100