Skip to content

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

Merged
bluss merged 1 commit into
bluss:masterfrom
Snehal-Reddy:fix-into-iter-slice
Nov 28, 2026
Merged

bluss merged 1 commit into
bluss:masterfrom
Snehal-Reddy:fix-into-iter-slice

Conversation

@Snehal-Reddy

Copy link
Copy Markdown
Contributor

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.
@bluss
bluss merged commit bcebcd5 into bluss:master Nov 28, 2026
7 checks passed
@bluss

bluss commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Thanks. The refactor ec06b5b was pushed on top of this, as my follow-up.

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

2 participants