Skip to content

Commit 145a582

Browse files
committed
Check that chdir fails for non-utf8 paths
1 parent 0eed5e6 commit 145a582

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// compile-flags: -Zmiri-disable-isolation
2+
3+
extern {
4+
pub fn chdir(dir: *const u8) -> i32;
5+
}
6+
7+
fn main() {
8+
let path = vec![0xc3u8, 0x28, 0];
9+
// test that `chdir` errors with invalid utf-8 path
10+
unsafe { chdir(path.as_ptr()) }; //~ ERROR is not a valid utf-8 string
11+
}

0 commit comments

Comments
 (0)