vst-rs icon indicating copy to clipboard operation
vst-rs copied to clipboard

Garbage param/preset/... names when maximum string size reached

Open helgoboss opened this issue 1 year ago • 0 comments

This is caused by a bug in the copy_string function that can cause a missing nul terminator:

https://github.com/RustAudio/vst-rs/blob/ab74a5682df4fc08e1f78a28fac12aad1ff5fe0b/src/interfaces.rs#L76

It should be max - 1, otherwise the nul terminator set by the previous statement will be overwritten and the C string becomes open-ended ... undefined behavior when the DAW reads this!

I'm aware that usage of this project is deprecated but I think there are still some plug-ins out there using it, so hope this helps.

helgoboss avatar Jun 10 '23 11:06 helgoboss