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
Describe the bug
Bug in lua/entities/gmod_wire_expression2/core/string.lua122: e2function string toChar(number n).
Calling this with the NaN value causes a lua error, and e2 crashes.
To Reproduce
Steps to reproduce the behavior:
Type the code toChar(0 / 0) in the e2 editor.
Put the chip.
It will show an error hint and crash.
Expected behavior
Possible fix:
e2functionstringtoChar(numbern)
ifn~=norn<0orn>255then-- Check on NaN and the byte range.returnself:throw("Invalid argument (" ..n..") (must be between 0 and 255)", "")
endreturnstring_char(n)
end
Also, the check above should be added in 139: e2function string toUnicodeChar(number byte) and, maybe, in other places.
The text was updated successfully, but these errors were encountered:
Describe the bug
Bug in
lua/entities/gmod_wire_expression2/core/string.lua
122: e2function string toChar(number n)
.Calling this with the NaN value causes a lua error, and e2 crashes.
To Reproduce
Steps to reproduce the behavior:
toChar(0 / 0)
in the e2 editor.Expected behavior
Possible fix:
Also, the check above should be added in
139: e2function string toUnicodeChar(number byte)
and, maybe, in other places.The text was updated successfully, but these errors were encountered: