davisjam / vuln-regex-detector

Detect vulnerable regexes in your project. REDOS, catastrophic backtracking.
MIT License
320 stars 28 forks source link

bin: handle false-y args #7

Closed davisjam closed 6 years ago

davisjam commented 6 years ago

Issue: This addresses #6.

Problem: If args were false-y, 'if ($arg)' would incorrectly evaluate to false. Specific problem was the regex /0/.

Solution: I changed all of the 'if ($arg)' to 'if (defined $arg)'.

Test: I added a test case in check-regex for the problematic regex.