-
-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: list index out of range #545
Comments
Can you |
@sonrohan Check highlighted text below
|
Bandit assumes if your code calls this function you are supplying the positional argument |
Why does it need to be positional? It's perfectly valid Python code to supply it as keyword argument. Therefore I claim this is a bug in |
This occurs when the keyword is a ast.Call in this case. Bandit cannot determine the value of any such call, so it should ignore, but not throw a traceback. |
An example which exhibits the problem:
|
The weak_cryptographic_key assumes a positional arg when it doesn't find a value for the keyword arg. The issue is that sometimes the keyword arg is a ast.Call or other undeterminate values. And as a result throws a Traceback. This change will make the plugin a little more robust so it doesn't throw the Traceback. It won't be able determine the value of the curve in this case, but can ignore it. Fixes PyCQA#545 Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
The weak_cryptographic_key assumes a positional arg when it doesn't find a value for the keyword arg. The issue is that sometimes the keyword arg is a ast.Call or other undeterminate values. And as a result throws a Traceback. This change will make the plugin a little more robust so it doesn't throw the Traceback. It won't be able determine the value of the curve in this case, but can ignore it. Fixes PyCQA#545 Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
The weak_cryptographic_key assumes a positional arg when it doesn't find a value for the keyword arg. The issue is that sometimes the keyword arg is a ast.Call or other undeterminate values. And as a result throws a Traceback. This change will make the plugin a little more robust so it doesn't throw the Traceback. It won't be able determine the value of the curve in this case, but can ignore it. Fixes PyCQA#545 Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
The weak_cryptographic_key assumes a positional arg when it doesn't find a value for the keyword arg. The issue is that sometimes the keyword arg is a ast.Call or other undeterminate values. And as a result throws a Traceback. This change will make the plugin a little more robust so it doesn't throw the Traceback. It won't be able determine the value of the curve in this case, but can ignore it. Fixes #545 Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
Bandit version
(bandit) [root@test BD]# bandit --version
bandit 1.6.2
python version = 2.7.5 (default, Jun 11 2019, 12:19:05) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
(bandit) [root@test BD]#
Actual error
The text was updated successfully, but these errors were encountered: