mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 02:54:05 +01:00
Misc.last: add a timeout in --regexp search to prevent various ReDoS attacks
This commit is contained in:
parent
b64926814b
commit
d4a71497c4
@ -455,7 +455,7 @@ class Misc(callbacks.Plugin):
|
||||
def f1(s, arg):
|
||||
"""Since we can't enqueue match objects into the multiprocessing queue,
|
||||
we'll just wrap the function to return bools."""
|
||||
if arg.search(s) is not None:
|
||||
if process(arg.search, s, timeout=0.1) is not None:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user