Skip to content

Commit

Permalink
Merge branch 'PHP-8.2' into PHP-8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Nov 13, 2024
2 parents b9c6f07 + 4124b04 commit 6f1d836
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ PHP NEWS
- FPM:
. Fixed GH-16432 (PHP-FPM 8.2 SIGSEGV in fpm_get_status). (Jakub Zelenka)

- GD:
. Fixed GH-16776 (imagecreatefromstring overflow). (David Carlier)

- Hash:
. Fixed GH-16711: Segfault in mhash(). (Girgias)

Expand Down
2 changes: 1 addition & 1 deletion ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ static int _php_ctx_getmbi(gdIOCtx *ctx)

do {
i = (ctx->getC)(ctx);
if (i < 0) {
if (i < 0 || mbi > (INT_MAX >> 7)) {
return -1;
}
mbi = (mbi << 7) | (i & 0x7f);
Expand Down
10 changes: 10 additions & 0 deletions ext/gd/tests/gh16771.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--TEST--
GH-16771 (UBSan abort in ext/gd/libgd/gd.c:1372)
--EXTENSIONS--
gd
--FILE--
<?php
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OIMzTvvJXvvJbml6XmnKzoqp7jg4bjgq3jgrnjg4g=');
imagecreatefromstring($string_mb);
--EXPECTF--
Warning: imagecreatefromstring(): Data is not in a recognized format in %s on line %d

0 comments on commit 6f1d836

Please sign in to comment.