Skip to content

Fix UB in IntoIter slice, clone, and Debug methods - #332

Open
Snehal-Reddy wants to merge 1 commit into
bluss:masterfrom
Snehal-Reddy:fix-into-iter-slice
Open

Snehal-Reddy wants to merge 1 commit into
bluss:masterfrom
Snehal-Reddy:fix-into-iter-slice

Conversation

@Snehal-Reddy

Copy link
Copy Markdown

Construct the remaining slice directly over index..v.len() instead of dereferencing self.v (whose 0..index slots have been moved out).

Fixes #331.

Construct the remaining slice directly over `index..v.len()` instead of dereferencing `self.v` (whose `0..index` slots have been moved out).

Fixes bluss#331.

This branch has not been deployed

No deployments
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.

IntoIter::{as_slice, clone, ..} materialize &[T] over moved out prefix slots, leading to undefined behavior

1 participant