Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whole server crashes with "malformed pattern" if weird input in search box #9

Open
nonchip opened this issue Sep 9, 2020 · 1 comment

Comments

@nonchip
Copy link

nonchip commented Sep 9, 2020

for example entering [ into the search box results in an "malformed pattern (missing ])" exception thrown by string.find in match_filter, crashing the whole server.

@nonchip
Copy link
Author

nonchip commented Sep 16, 2020

quick ugly hack for anyone encountering this: wrap string.find to call itself using pcall, but the mod should just be pcalling it to begin with.

example from my code:

orig_str_find = string.find
string.find = (...)->
  args = {...}
  ret = {pcall (-> orig_str_find unpack args)}
  return unpack ret,2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant