Description
These lines in unsafe fn do_resolve
convert a &mut [u8; _]
to a &mut SYMBOL_INFOW
:
backtrace-rs/src/symbolize/dbghelp.rs
Lines 226 to 227 in b65ab93
The SYMBOL_INFOW
type has inter-field padding, which means that this &mut SYMBOL_INFOW
could be used to write uninit bytes which would be exposed by the underlying [u8; _]
.
Note that the &mut SYMBOL_INFOW
is passed to an external function:
backtrace-rs/src/symbolize/dbghelp.rs
Line 234 in b65ab93
sym_from_addr
is an argument to this function:
backtrace-rs/src/symbolize/dbghelp.rs
Line 221 in b65ab93
Any call to do_resolve
which passes a sym_from_addr
argument which writes to these padding locations would cause undefined behavior.
I would recommend modifying SYMBOL_INFOW
with explicit padding fields to mitigate this problem.