Skip to content

Commit e1cdb7b

Browse files
committed
Manually initialize IMAGEHLP_LINEW64 rather than using mem::zeroed
This avoids an unsafe call as requested in #700 (comment)
1 parent a872587 commit e1cdb7b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/symbolize/dbghelp.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,13 @@ unsafe fn do_resolve(
266266
}
267267
let name = ptr::addr_of!(name_buffer[..name_len]);
268268

269-
let mut line = unsafe { mem::zeroed::<IMAGEHLP_LINEW64>() };
269+
let mut line = IMAGEHLP_LINEW64 {
270+
SizeOfStruct: 0,
271+
Key: core::ptr::null_mut(),
272+
LineNumber: 0,
273+
FileName: core::ptr::null_mut(),
274+
Address: 0,
275+
};
270276
line.SizeOfStruct = mem::size_of::<IMAGEHLP_LINEW64>() as u32;
271277

272278
let mut filename = None;

0 commit comments

Comments
 (0)