Skip to content

Commit 5a380ad

Browse files
committed
Avoid passing null pointer to cygwin_conv_path
1 parent d75c599 commit 5a380ad

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/symbolize/gimli/libs_windows.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ unsafe fn get_posix_path(long_path: &[u16]) -> Option<OsString> {
6565

6666
// If `size` is 0, returns needed buffer size, including null terminator;
6767
// or -1 if error.
68-
// Safety: **Confirmed from source:** If `size` is 0, `to` is not used.
6968
let name_len = unsafe {
7069
cygwin_conv_path(
7170
CCP_WIN_W_TO_POSIX,
7271
long_path.as_ptr().cast(),
73-
core::ptr::null_mut(),
72+
8 as *mut libc::c_void, // Avoid being null, and align enough
7473
0,
7574
)
7675
};

0 commit comments

Comments
 (0)