Bug fix for hardcoded passwords test
This commit is contained in:
parent
6b1211b561
commit
db1a78d4de
@ -5,3 +5,11 @@ def someFunction2(password):
|
||||
if password == "root":
|
||||
print "OK, logged in"
|
||||
|
||||
def noMatch(password):
|
||||
if password == '':
|
||||
print "No password!"
|
||||
|
||||
def NoMatch2(password):
|
||||
if password == "ajklawejrkl42348swfgkg":
|
||||
print "Nice password!"
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
f = open('/tmp/abc', 'w')
|
||||
f.write('def')
|
||||
f.close()
|
||||
f.close()
|
||||
|
||||
|
@ -42,5 +42,5 @@ def hardcoded_password(context, config):
|
||||
|
||||
# for every password in the list, check against the current string
|
||||
for word in word_list:
|
||||
if context.string_val == word:
|
||||
if context.string_val and context.string_val == word:
|
||||
return bandit.WARN, "Possible hardcoded password '(%s)'" % word
|
||||
|
Loading…
x
Reference in New Issue
Block a user