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 unspecified behavior in LLVM and UB in Rust. #130

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

Alexhuszagh
Copy link
Owner

Lexical itself used a high-level vector which is then directly cast to a String using uninitialized memory under the hood. Since the behavior never relied on the values of the reads, this wasn't ever seen as an issue, however, anything besides using ptr::write can invoke UB which lexical-core and lower-level APIs do not always use: they often use index (read-write) assignment. This initializes the underlying buffer of the vector to avoid any risk of potential UB.

Lexical itself used a high-level vector which is then directly cast to a
String using uninitialized memory under the hood. Since the behavior
never relied on the values of the reads, this wasn't ever seen as an issue,
however, anything besides using `ptr::write` can invoke UB which
lexical-core and lower-level APIs do not always use: they often use
index (read-write) assignment. This initializes the underlying buffer of
the vector to avoid any risk of potential UB.
@Alexhuszagh Alexhuszagh added the A-sec Issues with potential security implications. label Sep 13, 2024
@Alexhuszagh Alexhuszagh merged commit b2df282 into main Sep 13, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sec Issues with potential security implications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant