Skip to content

Conversation

@marti4d
Copy link
Collaborator

@marti4d marti4d commented May 7, 2025

Even though we all know that this code is logically okay because all bytes in the buffer will be overwritten, LLVM posits that any reference to uninitialized memory is not allowed to exist. The mere act of creating such a reference is immediate UB.

This is actually a known issue with Rust's Read trait -- There is no way to safely use Read without initializing the buffer first, even though we all know that it's going to get overwritten.

@marti4d marti4d force-pushed the fix_memreader_ub branch from bbb8d5d to abb3e7f Compare May 7, 2025 15:40
@marti4d marti4d merged commit 9a444d2 into rust-minidump:main May 13, 2025
16 checks passed
@marti4d marti4d deleted the fix_memreader_ub branch June 9, 2025 15:37
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.

2 participants