it assumes the file name will fit into 128 characters and overruns the allocated buffer otherwise
it's using CString::from_raw incorrectly (see the safety section in the rust docs)
This PR fixes both.
The second issue was causing crashes with STATUS_HEAP_CORRUPTION for me because it did some funky things when trying to de-allocate the CString (I think it double-frees and the second free also uses the wrong layout; didn't look into it more).
I know you're currently rewriting most of the library but I wanted to share this anyway in case anyone else runs into the same crash.
There are two issues in the
get_capture
functionCString::from_raw
incorrectly (see the safety section in the rust docs)This PR fixes both.
The second issue was causing crashes with
STATUS_HEAP_CORRUPTION
for me because it did some funky things when trying to de-allocate theCString
(I think it double-frees and the second free also uses the wrong layout; didn't look into it more).I know you're currently rewriting most of the library but I wanted to share this anyway in case anyone else runs into the same crash.