Merge pull request #2419 from tausbn/python-fix-use-of-input-fp

Python: Fix false positive for `py/use-of-input`.
This commit is contained in:
Rasmus Wriedt Larsen
2019-11-25 12:08:39 +01:00
committed by GitHub
2 changed files with 14 additions and 1 deletions

View File

@@ -14,5 +14,8 @@ import python
from CallNode call, Context context, ControlFlowNode func
where
context.getAVersion().includes(2, _) and call.getFunction() = func and func.refersTo(context, Object::builtin("input"), _, _)
context.getAVersion().includes(2, _) and
call.getFunction() = func and
func.pointsTo(context, Value::named("input"), _) and
not func.pointsTo(context, Value::named("raw_input"), _)
select call, "The unsafe built-in function 'input' is used."