reaper-oss / sws

The SWS extension is a collection of features that seamlessly integrate into REAPER, the Digital Audio Workstation (DAW) software by Cockos, Inc
https://www.sws-extension.org/
MIT License
448 stars 85 forks source link

BR_Win32_WritePrivateProfileString crashes, when string keyName is set to nil. #956

Closed mespotine closed 5 years ago

mespotine commented 6 years ago

The following line crashes Reaper, which happens, when the second parameter is set to nil:

reaper.BR_Win32_WritePrivateProfileString("", nil, "", reaper.GetExePath().."\reaper.ini") The other parameter have no problem with being set to nil.

When I use GetResourcePath in it:

reaper.BR_Win32_WritePrivateProfileString("", nil, "", reaper.GetResourcePath().."\reaper.ini")

Reaper doesn't crash but Lua behaves weird with the script not running anymore, as if Lua crashed on this specific script-instance...

Tested on portable installation of Reaper 5.70/x64 with SWS 2.9.7 on Windows 7.

cfillion commented 6 years ago

I can't reproduce. Both cases return false without crashing here. The nil is converted to an empty string by REAPER, which gives it to SWS, which in turn passes it straight to Windows (2.9.7 and earlier).

mespotine commented 6 years ago

Thanks :)

Ok, I'll check further. Maybe, if the passing of nil is really done by Reaper, it had been fixed somewhere in the last versions of Reaper.

I'll check again with the newest versions(including the prereleases) and with non-portable...

nofishonfriday commented 6 years ago

Reopening this as I saw the crash got reproduced. https://forum.cockos.com/showthread.php?t=209749