Skip to content

Commit

Permalink
Print to tty when no REDoS found
Browse files Browse the repository at this point in the history
Rather than silence
  • Loading branch information
b-c-ds authored and bcaller committed Dec 24, 2020
1 parent 97e024a commit d677a13
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion regexploit/bin/regexploit.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ def main():
logging.basicConfig(level=logging.DEBUG)
sys.argv.remove("-vv")

isatty = sys.stdin.isatty()
output = TextOutput()
try:
for line in fileinput.input():
found = False
for _ in find_redos(line.rstrip("\n"), 0, output):
pass
found = True
if isatty and not found:
print("No REDoS found.")
except KeyboardInterrupt:
pass

Expand Down

0 comments on commit d677a13

Please sign in to comment.