We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The documentation for LocalKey states
LocalKey
The with method yields a reference to the contained value which cannot outlive the current thread or escape the given closure.
with
The current dom context is stored in a thread local and its lifetime is extended beyond, and escapes, the closure
yakui/crates/yakui-core/src/context.rs
Lines 34 to 41 in ba96329
In practice, this can lead to a use-after-free if the current dom is accessed in the destructor of another thread local.
This is similar to rust-random/rand#968, and they fixed it by wrapping the thread local in a std::rc::Rc. That issue also links to a test case that actually produces a use-after-free on macOS which would also apply to Yakui.
std::rc::Rc
The text was updated successfully, but these errors were encountered:
Cool, thank you for the note on this! I'm interested in fixing this.
Sorry, something went wrong.
No branches or pull requests
The documentation for
LocalKey
statesThe current dom context is stored in a thread local and its lifetime is extended beyond, and escapes, the closure
yakui/crates/yakui-core/src/context.rs
Lines 34 to 41 in ba96329
In practice, this can lead to a use-after-free if the current dom is accessed in the destructor of another thread local.
This is similar to rust-random/rand#968, and they fixed it by wrapping the thread local in a
std::rc::Rc
.That issue also links to a test case that actually produces a use-after-free on macOS which would also apply to Yakui.
The text was updated successfully, but these errors were encountered: