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

Fix incorrect deferencing of Windows window handles #367

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

Wumpf
Copy link
Contributor

@Wumpf Wumpf commented Oct 5, 2024

Windows handles are pointers by type, but dereferencing these doesn't have any meaning and naturally may just crash (it does ;-)) - if you're lucky this is caught by Rust debug checks complaining about alignment, if you're not it's just a segfault.

Tested this on https://github.com/Wumpf/minifb_wgpu_web_and_desktop (at Wumpf/minifb_wgpu_web_and_desktop@e39be06)

Windows handles are pointer by type, but dereferencing these doesn't have any meaning and naturally may just crash.
@Wumpf Wumpf changed the title Remove incorrect deferencing of window handles. Remove incorrect deferencing of Windows window handles Oct 5, 2024
@Wumpf Wumpf changed the title Remove incorrect deferencing of Windows window handles Fix incorrect deferencing of Windows window handles Oct 5, 2024
@emoon emoon merged commit cc7267f into emoon:master Oct 5, 2024
4 checks passed
@emoon
Copy link
Owner

emoon commented Oct 5, 2024

Great! Thanks :)

@Wumpf Wumpf deleted the fix-windows-window-handles branch October 5, 2024 15:54
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.

Incorrect construction of a Window's Win32 RawWindowHandle causes segmentation fault/pointer deref panic
2 participants