google/flatbuffers

Rust: various unsafe traits/functions meant for gencode in public API

Open

#6627 opened on May 10, 2021

View on GitHub
 (28 comments) (2 reactions) (0 assignees)C++ (25,952 stars) (3,564 forks)batch import
help wantedpr-requestedrust

Description

The following safe code will segfault:

fn main() {
    let ptr: &&u8 = flatbuffers::follow_cast_ref(&[1, 2, 3, 4, 5, 6, 7, 8], 0);
    println!("{}", **ptr);
}

Contributor guide