Merge pull request #21603 from github/tausbn/python-port-use-of-exit

Python: Port UseOfExit.ql
This commit is contained in:
Taus
2026-04-13 13:20:29 +02:00
committed by GitHub

View File

@@ -12,10 +12,12 @@
*/
import python
private import LegacyPointsTo
private import semmle.python.ApiGraphs
from CallNode call, string name
where call.getFunction().(ControlFlowNodeWithPointsTo).pointsTo(Value::siteQuitter(name))
where
name = ["exit", "quit"] and
call = API::builtin(name).getACall().asCfgNode()
select call,
"The '" + name +
"' site.Quitter object may not exist if the 'site' module is not loaded or is modified."