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
{{ message }}
Repository navigation
CF_GetClipboard may crash in Lua, if buf_sz=20000000000000 #1365
The following call of CF_GetClipboard causes problems in Reaper:
A,B = reaper.CF_GetClipboard("",20000000000000)
This either crashes Reaper completely or freezes the Lua-instance of the script. Means, if I try to run the script, it will not run until I restart Reaper.
Maybe some sanity checks would be a good idea.
There's a check but it only guards against large positive numbers. 20000000000000, as a signed 32-bit integer, is -1662697472 which slips right through it. Thanks, fixing!
It turns out it's the change that allowed omitting the buf/buf_sz parameters that is letting this happen (the buffer fails to be resized to fit the clipboard data).
Activity
cfillion commentedon May 30, 2020
There's a check but it only guards against large positive numbers.
20000000000000, as a signed 32-bit integer, is-1662697472which slips right through it. Thanks, fixing!ReaScript: fix automatic resizing of CF_GetClipboard's output buffer
cfillion commentedon May 31, 2020
It turns out it's the change that allowed omitting the buf/buf_sz parameters that is letting this happen (the buffer fails to be resized to fit the clipboard data).
ReaScript: fix automatic resizing of CF_GetClipboard's output buffer