Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybaloney committed Feb 3, 2020
2 parents 3be4398 + 233a7da commit 06ccf4b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class BindAllInterfacesInspection : PyInspection() {
if (node == null) return
val calleeName = node.callee?.name ?: return
if (calleeName != "bind") return
if (node.arguments.isNullOrEmpty()) return
val firstArg = node.arguments.first() ?: return

// Takes single argument (IP)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/security/validators/BuiltinExecInspection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BuiltinExecInspection : PyInspection() {
if (!qualifiedName.equals("exec")) return

// First argument as a string literal is ok
if (node.arguments.isEmpty()) return
if (node.arguments.isNullOrEmpty()) return
if (node.arguments.first() is PyStringLiteralExpression) return

holder?.registerProblem(node, Checks.BuiltinExecCheck.getDescription())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class DjangoRawSqlInspection : PyInspection() {
if (node.containingFile !is PyFile) return
if (!hasImportedNamespace(node.containingFile as PyFile, "django")) return

if (node.arguments.isNullOrEmpty()) return
val sqlStatement = node.arguments.first() ?: return
if (sqlStatement !is PyStringLiteralExpression) return
val param = Regex("%s")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SubprocessShellModeInspection : PyInspection() {
// Check this is an import from the subprocess module
if (qualifiedName.startsWith("subprocess.").not()) return
val calleeName = node.callee?.name ?: return
if (node.arguments.isEmpty()) return
if (node.arguments.isNullOrEmpty()) return

// Match the method name against one of shellMethodNames
if (!listOf(*shellMethodNames).contains(calleeName)) return
Expand Down

0 comments on commit 06ccf4b

Please sign in to comment.