Skip to content

Fix latent UAF by boxing Compress to stabilize cinfo address#53

Open
ain5721 wants to merge 1 commit into
ImageOptim:mainfrom
ain5721:fix-cinfo-backpointer-uaf
Open

Fix latent UAF by boxing Compress to stabilize cinfo address#53
ain5721 wants to merge 1 commit into
ImageOptim:mainfrom
ain5721:fix-cinfo-backpointer-uaf

Conversation

@ain5721
Copy link
Copy Markdown

@ain5721 ain5721 commented Mar 12, 2026

This PR boxes the Compress struct inside CompressStarted to ensure the jpeg_compress_struct maintains a stable heap address after start_compress is called.

This prevents internal C back-pointers (like those in progressive huffman or custom destination managers) from becoming dangling pointers to a popped stack frame when the struct is moved.

Fixes issue #52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant