Python: Use API graphs instead of points-to for simple built-ins

Also extends the list of known built-ins slightly, to add some that were
missing.
This commit is contained in:
Taus
2026-03-19 15:33:04 +00:00
parent 7a33e2f539
commit f4841e1f39
6 changed files with 32 additions and 36 deletions

View File

@@ -10,9 +10,10 @@
*/
import python
private import LegacyPointsTo
private import semmle.python.types.Builtins
private import semmle.python.ApiGraphs
from CallNode call, ControlFlowNodeWithPointsTo func
where major_version() = 2 and call.getFunction() = func and func.pointsTo(Value::named("apply"))
from CallNode call
where
major_version() = 2 and
call = API::builtin("apply").getACall().asCfgNode()
select call, "Call to the obsolete builtin function 'apply'."