mirror of
https://github.com/github/codeql.git
synced 2026-05-21 14:47:10 +02:00
Moves the existing points-to predicates to the newly added class `ControlFlowNodeWithPointsTo` which resides in the `LegacyPointsTo` module. (Existing code that uses these predicates should import this module, and references to `ControlFlowNode` should be changed to `ControlFlowNodeWithPointsTo`.) Also updates all existing points-to based code to do just this.
22 lines
602 B
Plaintext
22 lines
602 B
Plaintext
/**
|
|
* @name Use of exit() or quit()
|
|
* @description exit() or quit() may fail if the interpreter is run with the -S option.
|
|
* @kind problem
|
|
* @tags quality
|
|
* reliability
|
|
* correctness
|
|
* @problem.severity warning
|
|
* @sub-severity low
|
|
* @precision very-high
|
|
* @id py/use-of-exit-or-quit
|
|
*/
|
|
|
|
import python
|
|
private import LegacyPointsTo
|
|
|
|
from CallNode call, string name
|
|
where call.getFunction().(ControlFlowNodeWithPointsTo).pointsTo(Value::siteQuitter(name))
|
|
select call,
|
|
"The '" + name +
|
|
"' site.Quitter object may not exist if the 'site' module is not loaded or is modified."
|