Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Slices may not use null pointers #9

Closed
Stebalien opened this issue Jan 28, 2022 · 0 comments · Fixed by filecoin-project/filecoin-ffi#247
Closed

Slices may not use null pointers #9

Stebalien opened this issue Jan 28, 2022 · 0 comments · Fixed by filecoin-project/filecoin-ffi#247

Comments

@Stebalien
Copy link
Member

E.g., https://github.com/filecoin-project/filecoin-ffi/blob/45dfb5502934659324edb513a97c5f2184031ab8/rust/src/proofs/types.rs#L262

This is unsafe if proof_ptr is null (which is is by default) because slices are specified to be non-null (to allow for Option<&[T]> optimizations).

There's also the fact that the linked code will drop null.

dignifiedquire added a commit to filecoin-project/filecoin-ffi that referenced this issue Mar 18, 2022
- *mut ptr to indicate ownership
- Boxed slices instead of vecs for safe transfers
- expanded checks for null ptrs

Closes filecoin-project/rust-fil-ffi-toolkit#9
dignifiedquire added a commit to filecoin-project/filecoin-ffi that referenced this issue Apr 12, 2022
- *mut ptr to indicate ownership
- Boxed slices instead of vecs for safe transfers
- expanded checks for null ptrs

Closes filecoin-project/rust-fil-ffi-toolkit#9
dignifiedquire added a commit to filecoin-project/filecoin-ffi that referenced this issue Apr 12, 2022
- *mut ptr to indicate ownership
- Boxed slices instead of vecs for safe transfers
- expanded checks for null ptrs

Closes filecoin-project/rust-fil-ffi-toolkit#9
dignifiedquire added a commit to filecoin-project/filecoin-ffi that referenced this issue Apr 22, 2022
- *mut ptr to indicate ownership
- Boxed slices instead of vecs for safe transfers
- expanded checks for null ptrs

Closes filecoin-project/rust-fil-ffi-toolkit#9
Stebalien pushed a commit to filecoin-project/filecoin-ffi that referenced this issue Apr 28, 2022
- *mut ptr to indicate ownership
- Boxed slices instead of vecs for safe transfers
- expanded checks for null ptrs

Closes filecoin-project/rust-fil-ffi-toolkit#9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant