Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable JIT optimization for user code and allow string.find in plain…
… mode Disabling LuaJIT for user code enables normal working of debug.sethook() even for loops. The drawback is that that code will run more slowly. The fourth parameter of string.find indicates whether the second parameter should be interpreted literally (true) or as a pattern (false). Allowing patterns enables DoS attacks, but it's possible to allow literal matching with little effort, by disallowing the function only if the fourth parameter (plain mode) is not `true`.
- Loading branch information
Showing
1 changed file
with
21 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b487783
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, okay, that is a valid criticism; I didn't think of that. I'd still like to keep the message as it is, as the number of parameters is often counted including the object reference as the first parameter in many debug / error messages (so people are used to this way of counting), and second because
plain
could also be interpreted as just a word if not knowing the parameters ofstring.find
by their name.