RustAudio / vst-rs

VST 2.4 API implementation in rust. Create plugins or hosts. Previously rust-vst on the RustDSP group.
MIT License
1.04k stars 90 forks source link

#170 Fix SysExEvent containing invalid data on 64-bit systems #171

Closed helgoboss closed 2 years ago

helgoboss commented 2 years ago

Tested on REAPER win64.

glowcoil commented 2 years ago

Thanks for taking the time to debug and fix this. Unfortunately, the new From implementation in this PR is still unsound, since you can manually construct an api::Event with event_type set to SysEx, and from will read out of bounds regardless of whether a valid reference to a SysExEvent was passed (and, even in the case where it's a valid SysExEvent, you can pass arbitrary values for the data pointer and size). Would you mind replacing the From impl with something like unsafe fn from_raw_event(*mut api::Event) -> Event<'a>, with a comment outlining the safety requirements?

helgoboss commented 2 years ago

Sure, that makes sense. Probably after the weekend.

helgoboss commented 2 years ago

... or today :) Feel free to suggest different wording.

glowcoil commented 2 years ago

Awesome, thanks! Looks good to me.