io_jail: fix missing null terminator for close_fds test

BUG=None
TEST=cargo test -p io_jail

Change-Id: Ib732daca97cb303ec5013e616e6a7037b11af589
Reviewed-on: https://chromium-review.googlesource.com/1056414
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
Zach Reizner 2018-05-11 18:13:57 -07:00 committed by chrome-bot
parent 5e05a8331d
commit d913acb984

View file

@ -602,7 +602,7 @@ mod tests {
// Test that open FDs get closed and that FDs in the inherit list are left open.
fn close_fds() {
unsafe { // Using libc to open/close FDs for testing.
const FILE_PATH: &'static str = "/dev/null";
const FILE_PATH: &[u8] = b"/dev/null\0";
let j = Minijail::new().unwrap();
let first = libc::open(FILE_PATH.as_ptr() as *const i8, libc::O_RDONLY);
assert!(first >= 0);