Check that chdir
fails for non-utf8 paths
This commit is contained in:
parent
0eed5e64de
commit
145a5826d5
11
tests/compile-fail/chdir_invalid_path.rs
Normal file
11
tests/compile-fail/chdir_invalid_path.rs
Normal file
@ -0,0 +1,11 @@
|
||||
// compile-flags: -Zmiri-disable-isolation
|
||||
|
||||
extern {
|
||||
pub fn chdir(dir: *const u8) -> i32;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let path = vec![0xc3u8, 0x28, 0];
|
||||
// test that `chdir` errors with invalid utf-8 path
|
||||
unsafe { chdir(path.as_ptr()) }; //~ ERROR is not a valid utf-8 string
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user