Skip to content

Fix possible use after free in clear functions#647

Open
sgued wants to merge 1 commit intorust-embedded:mainfrom
sgued:646-clear-use-after-free
Open

Fix possible use after free in clear functions#647
sgued wants to merge 1 commit intorust-embedded:mainfrom
sgued:646-clear-use-after-free

Conversation

@sgued
Copy link
Contributor

@sgued sgued commented Feb 13, 2026

Also, the drop test of deque is renamed to test_drop to avoid conflicts with the drop function.

Fixes #646.

@zeenix
Copy link
Contributor

zeenix commented Feb 15, 2026

@sgued Thanks so much for fixing this! I hope you don't mind me taking the liberty to improve on the description here, mainly adding . at the end of a sentence and adding vertical spacing between paragraphs.

zeenix
zeenix previously approved these changes Feb 15, 2026
src/deque.rs Outdated
}
let this = Guard(self);
// SAFETY: Guard will be dropped and lead to a consistent empty state even in the case of a
// panic leading to unwinding during the dropping on an item
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// panic leading to unwinding during the dropping on an item
// panic leading to unwinding during the dropping of an item.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed it.

reitermarkus
reitermarkus previously approved these changes Feb 15, 2026
@sgued sgued dismissed stale reviews from reitermarkus and zeenix via 3630d6e February 16, 2026 08:54
@sgued sgued force-pushed the 646-clear-use-after-free branch from 8d03f31 to 3630d6e Compare February 16, 2026 08:54
The `drop` test of `deque` is renamed to `test_drop` to avoid name
conflicts with the `std::mem::drop` function.

Fix rust-embedded#646
@sgued sgued force-pushed the 646-clear-use-after-free branch from 3630d6e to e458255 Compare February 16, 2026 08:55
@sgued
Copy link
Contributor Author

sgued commented Feb 16, 2026

I fixed the typo and rephrased the commit message to match the PR

@sgued sgued requested review from reitermarkus and zeenix February 16, 2026 08:55
@sgued sgued enabled auto-merge February 16, 2026 08:56
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.

Use-after-free when items panic in drop impls

3 participants