-
Notifications
You must be signed in to change notification settings - Fork 15
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
Maybe unsound in RLocal::new #653
Comments
It's really an internal function from an internal crate (neither are meant to be used in other projects). We can make it |
Thanks for your reply, I think maybe same problem for ark/crates/harp/src/vector/list.rs Line 65 in a569d6e
index ptr offset is not been varify.and ark/crates/ark/src/sys/unix/console.rs Line 13 in a569d6e
ark/crates/ark/src/sys/windows/console.rs Line 37 in a569d6e
Line 162 in 1366044
I understand that these functions are not intended for external use, but in that case it might be more appropriate to declare them as pub(crate) . This will ensure that future projects on these modules will not cause possible unsound problems, thank you!
|
Note that we have cross-crate internal dependencies too. |
Hello, thank you for your contribution in this project, I am scanning the unsoundness problem in rust project.
I notice the following code:
Considering that
pub mod raii
, andnew
is also a pub function. I assume that users can directly call this function. This potential situation could result inlibr::get
being called to a null pointer, and might trigger undefined behavior (UB). For safety reasons, I felt it necessary to report this issue. If you have performed checks elsewhere that ensure this is safe, please don’t take offense at my raising this issue.I suggest Several possible fixes:
RLocal
ornew
, they should not marked aspub
, at least itsnew
should not marked aspub
new
method should add additional check for null pointer.The text was updated successfully, but these errors were encountered: