AlexEne / AlexEne/rust_hawktracer_sys
Functions that use raw pointers should be unsafe
Offen
- Vorherrschende Sprache
- Rust
- Sterne
- 0
- Forks
- 4
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Functions like these are a loophole in Rust's safety:
```rust
pub fn add_cached_mapping(name: *mut i8) -> u64 {
```
```rust
add_cached_mapping(12345 as *mut i8);
```
can cause a segfault despite being "safe".
These functions should be either marked as `unsafe`, or take `CStr`, or a `&'static str` or `&'static [u8]` and checking them for `\0`.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.