Skip to content

Commit fad55b3

Browse files
authored
Python: Reimplement py/use-of-input
1 parent fe12e62 commit fad55b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/ql/src/Expressions/UseofInput.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
*/
1212

1313
import python
14+
import semmle.python.dataflow.new.DataFlow
15+
import semmle.python.ApiGraphs
1416

15-
from CallNode call, Context context, ControlFlowNode func
17+
from DataFlow::CallCfgNode call
1618
where
17-
context.getAVersion().includes(2, _) and
18-
call.getFunction() = func and
19-
func.pointsTo(context, Value::named("input"), _) and
20-
not func.pointsTo(context, Value::named("raw_input"), _)
19+
call = API::builtin("input").getACall() and
20+
call != API::builtin("raw_input").getACall()
2121
select call, "The unsafe built-in function 'input' is used in Python 2."

0 commit comments

Comments
 (0)