mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Python: Refactor Dill.qll
So it matches the layout of all our other qll modules modeling a PyPI package.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Provides classes modeling security-relevant aspects of the 'dill' package.
|
* Provides classes modeling security-relevant aspects of the `dill` PyPI package.
|
||||||
* See https://pypi.org/project/dill/.
|
* See https://pypi.org/project/dill/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -10,18 +10,24 @@ private import semmle.python.Concepts
|
|||||||
private import semmle.python.ApiGraphs
|
private import semmle.python.ApiGraphs
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A call to `dill.loads`
|
* Provides models for the `dill` PyPI package.
|
||||||
* See https://pypi.org/project/dill/ (which currently refers you
|
* See https://pypi.org/project/dill/.
|
||||||
* to https://docs.python.org/3/library/pickle.html#pickle.loads)
|
|
||||||
*/
|
*/
|
||||||
private class DillLoadsCall extends Decoding::Range, DataFlow::CallCfgNode {
|
private module Dill {
|
||||||
DillLoadsCall() { this = API::moduleImport("dill").getMember("loads").getACall() }
|
/**
|
||||||
|
* A call to `dill.loads`
|
||||||
|
* See https://pypi.org/project/dill/ (which currently refers you
|
||||||
|
* to https://docs.python.org/3/library/pickle.html#pickle.loads)
|
||||||
|
*/
|
||||||
|
private class DillLoadsCall extends Decoding::Range, DataFlow::CallCfgNode {
|
||||||
|
DillLoadsCall() { this = API::moduleImport("dill").getMember("loads").getACall() }
|
||||||
|
|
||||||
override predicate mayExecuteInput() { any() }
|
override predicate mayExecuteInput() { any() }
|
||||||
|
|
||||||
override DataFlow::Node getAnInput() { result = this.getArg(0) }
|
override DataFlow::Node getAnInput() { result = this.getArg(0) }
|
||||||
|
|
||||||
override DataFlow::Node getOutput() { result = this }
|
override DataFlow::Node getOutput() { result = this }
|
||||||
|
|
||||||
override string getFormat() { result = "dill" }
|
override string getFormat() { result = "dill" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user