Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NULL pointer dereference in stb_image #1647

Merged
merged 1 commit into from
Mar 19, 2023
Merged

Conversation

mbrubeck
Copy link
Contributor

A bug in error handling in the stb_image C library could cause a NULL pointer dereference when attempting to load an invalid or unsupported image file. This is fixed in version 0.2.5 and later of the stb_image Rust crate, by patching the C code to correctly handle NULL pointers.

See servo/rust-stb-image#102 for more details.

@Shnatsel
Copy link
Member

Thank you! Merging.

@Shnatsel Shnatsel merged commit 06a7d1f into rustsec:main Mar 19, 2023
@8573
Copy link
Contributor

8573 commented Mar 19, 2023

This fix seems liable to get lost the next time the vendored C file is updated to a new upstream version, as it appears to have been the last time it was changed. Would it be reasonable/cost-effective for Servo to take steps to mitigate this risk, such as patching the C file at build-time instead (like how Linux distros patch upstream source code) or at least adding a warning in the comment at the top of the file?

@8573
Copy link
Contributor

8573 commented Mar 19, 2023

I guess opening a ticket in the Servo repository is more appropriate.

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.

3 participants