about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail-dep/libc/memchr_null.rs
blob: b6b4b62e6210743d661e0154696a0f4e17d0fc98 (plain)
1
2
3
4
5
6
7
8
use std::ptr;

// null is explicitly called out as UB in the C docs.
fn main() {
    unsafe {
        libc::memchr(ptr::null(), 0, 0); //~ERROR: null pointer
    }
}