Skip to content

Commit

Permalink
add type checking (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
teeann authored and ericwb committed Sep 23, 2019
1 parent ca6d283 commit 9e32438
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bandit/plugins/hashlib_new_insecure_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def hashlib_new(context):
args = context.call_args
keywords = context.call_keywords
name = args[0] if args else keywords['name']
if name.lower() in ('md4', 'md5'):
if isinstance(name, str) and name.lower() in ('md4', 'md5'):
return bandit.Issue(
severity=bandit.MEDIUM,
confidence=bandit.HIGH,
Expand Down

0 comments on commit 9e32438

Please sign in to comment.