Repository navigation
Document the safety assumptions in use of Weak - #429
briansmith wants to merge 1 commit into
Conversation
d98896b to
1d37e84
Compare
1d37e84 to
da11e27
Compare
| // | ||
| // Cryptographic security: We assume any implementation of `getrandom` | ||
| // we find is libc's `getrandom` though this isn't guaranteed. | ||
| let func: &'static GetRandomFn = unsafe { func.as_ref() }; |
There was a problem hiding this comment.
In my understanding, this variant is also incorrect. You have transformed "function pointer" to "reference to function pointer".
|
I don't think it's possible to cast to a function pointer without transmute, here are the docs: https://doc.rust-lang.org/std/primitive.fn.html#casting-to-and-from-integers |
13c6afb to
8f1115b
Compare
fptr.cast<T>() and dereference instead of mem::transmute(fptr).Weak
Make the conversion from `NonNull<c_void>` to a function pointer more explicit and document the safety assumptions.
8f1115b to
cc3e756
Compare
|
Just to reiterate: It is concerning that we only use |
|
Yes, right now we have built-only CI jobs for many targets. We probably will need to use VMs for targets like NetBSD (I don't think self-hosted runners will be a practical option for us). Looking into https://github.com/vmactions can be a good starting point. It's probably better to discuss it in a separate issue. |
|
@briansmith |
|
Yes, I will revisit this when we have a testing solution for it. |
Make the conversion from
NonNull<c_void>to a function pointer more explicit and document the safety assumptions.