This commit is contained in:
Cédric Bonhomme 2020-01-05 13:08:57 +01:00
parent caed1e9031
commit ba558d34e4
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
2 changed files with 4 additions and 4 deletions

View file

@ -83,7 +83,7 @@ def main():
defaultpattern defaultpattern
for commit in commits: for commit in commits:
if isinstance(defaultpattern, typing.Pattern): if isinstance(defaultpattern, typing.Pattern):
ret = find_vuln(commit, pattern=defaultpattern, versbose=args.v) ret = find_vuln(commit, pattern=defaultpattern, verbose=args.v)
if ret: if ret:
rcommit = ret['commit'] rcommit = ret['commit']
_, potential_vulnerabilities = summary(rcommit, _, potential_vulnerabilities = summary(rcommit,
@ -97,7 +97,7 @@ def main():
found += 1 found += 1
elif isinstance(defaultpattern, list): elif isinstance(defaultpattern, list):
for p in defaultpattern: for p in defaultpattern:
ret = find_vuln(commit, pattern=p, versbose=args.v) ret = find_vuln(commit, pattern=p, verbose=args.v)
if ret: if ret:
rcommit = ret['commit'] rcommit = ret['commit']
_, potential_vulnerabilities = summary(rcommit, _, potential_vulnerabilities = summary(rcommit,

View file

@ -78,10 +78,10 @@ def get_patterns(patterns_path=PATTERNS_PATH):
return patterns return patterns
def find_vuln(commit, pattern, versbose=False): def find_vuln(commit, pattern, verbose=False):
m = pattern.search(commit.message) m = pattern.search(commit.message)
if m: if m:
if versbose: if verbose:
print("Match found: {}".format(m.group(0)), file=sys.stderr) print("Match found: {}".format(m.group(0)), file=sys.stderr)
print(commit.message, file=sys.stderr) print(commit.message, file=sys.stderr)
print("---", file=sys.stderr) print("---", file=sys.stderr)