You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows, for example, to read uninitialized memory in safe code:
// x11 = "2.18"fnmain(){let wrong = x11::xlib::XCirculateEvent{// Wrong tagtype_: x11::xlib::ButtonPress,// All other fields don't matterserial:0,send_event:0,display: core::ptr::null_mut(),event:0,window:0,place:0,};// button event have more fields, so this reads uninitialized memoryprintln!("{:?}", x11::xlib::XEvent{ circulate: wrong });}
The
Debug
implementation forXEvent
assumes that.type_
is set right, but it is public and can be set to any value in safe code.https://github.com/erlepereira/x11-rs/blob/c4dcb13ae894c761722769088829d5cd7db3fb71/src/xlib.rs#L1042-L1049
This allows, for example, to read uninitialized memory in safe code:
Example outputs:
miri
output:spoiler
The text was updated successfully, but these errors were encountered: