script_bindings: Check for null pointer before dereferencing proxy handler custom data#36869
Merged
script_bindings: Check for null pointer before dereferencing proxy handler custom data#36869
Conversation
…ndler custom data. Signed-off-by: Josh Matthews <[email protected]>
mukilan
approved these changes
May 6, 2025
Signed-off-by: Josh Matthews <[email protected]>
Narfinger
pushed a commit
to Narfinger/servo
that referenced
this pull request
May 6, 2025
…ndler custom data (servo#36869) While the vast majority of DOM proxy objects created have a non-null pointer in the handler's extra data field, there is one place we create a proxy object that has a null pointer: https://github.com/servo/servo/blob/8b05b7449d3ceaeb6ae834246012ac04a4f048c6/components/script/window_named_properties.rs#L76 . Before servo#36818, dereferencing this null pointer was undefined behaviour that was silently being ignored; now that Rust 1.86 adds debug pointer validity checks, we get a panic when trying to dereference it. Testing: Tested about:memory with rustc 1.86. --------- Signed-off-by: Josh Matthews <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While the vast majority of DOM proxy objects created have a non-null pointer in the handler's extra data field, there is one place we create a proxy object that has a null pointer:
servo/components/script/window_named_properties.rs
Line 76 in 8b05b74
Testing: Tested about:memory with rustc 1.86.