Skip to content

[pull] master from php:master - #1042

Merged
pull[bot] merged 10 commits into
dolfly:masterfrom
php:master
Aug 26, 2026
Merged

[pull] master from php:master#1042
pull[bot] merged 10 commits into
dolfly:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Aug 26, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

lazerg and others added 10 commits August 26, 2026 12:33
imagebmp() writes its pixel data a byte at a time, and the gd stream
context turned each of those bytes into its own php_stream_write() call.
PHP streams do no write buffering, so a 1920x1080 truecolor image cost
about six million write syscalls. libgd's own FILE context does not show
this because stdio buffers for it.

Buffering the stream context in 8 KB chunks takes that image from 9.5s
to 0.02s here, with byte-identical output. imagewbmp(), imagegd() and
imagegd2() go through the same context and were writing per byte too, so
they get the same fix. imagexbm() goes through the same context but
writes its output via putBuf rather than per-byte putC, so it was not
affected by this bug and sees no change from this patch.

Close GH-23460
* PHP-8.4:
  Fix GH-23457: imagebmp() is extremely slow when writing to a file
* PHP-8.5:
  Fix GH-23457: imagebmp() is extremely slow when writing to a file
* PHP-8.4:
  [ci skip] NEWS
  Fix GH-19320: Prevent FPM UID and GID overflow (#22986)
* PHP-8.5:
  [ci skip] NEWS
  Fix GH-19320: Prevent FPM UID and GID overflow (#22986)
Here we passes a properly null-terminated copy of the shortened path
to `phar_mount_entry()` instead and keep `test` alive until error
formatting and manifest lookup have completed.
* origin/PHP-8.4:
  Fix GH-23418: UAF when accessing mounted Phar subdirectories (#23442)
* PHP-8.5:
  Fix GH-23418: UAF when accessing mounted Phar subdirectories (#23442)
@pull pull Bot locked and limited conversation to collaborators Aug 26, 2026
@pull pull Bot added the ⤵️ pull label Aug 26, 2026
@pull
pull Bot merged commit a6b1a9e into dolfly:master Aug 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants