Skip to content

Commit 9180257

Browse files
committed
Python: Refactor Dill.qll
So it matches the layout of all our other qll modules modeling a PyPI package.
1 parent f9333fc commit 9180257

File tree

1 file changed

+16
-10
lines changed
  • python/ql/lib/semmle/python/frameworks

1 file changed

+16
-10
lines changed
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Provides classes modeling security-relevant aspects of the 'dill' package.
2+
* Provides classes modeling security-relevant aspects of the `dill` PyPI package.
33
* See https://pypi.org/project/dill/.
44
*/
55

@@ -10,18 +10,24 @@ private import semmle.python.Concepts
1010
private import semmle.python.ApiGraphs
1111

1212
/**
13-
* A call to `dill.loads`
14-
* See https://pypi.org/project/dill/ (which currently refers you
15-
* to https://docs.python.org/3/library/pickle.html#pickle.loads)
13+
* Provides models for the `dill` PyPI package.
14+
* See https://pypi.org/project/dill/.
1615
*/
17-
private class DillLoadsCall extends Decoding::Range, DataFlow::CallCfgNode {
18-
DillLoadsCall() { this = API::moduleImport("dill").getMember("loads").getACall() }
16+
private module Dill {
17+
/**
18+
* A call to `dill.loads`
19+
* See https://pypi.org/project/dill/ (which currently refers you
20+
* to https://docs.python.org/3/library/pickle.html#pickle.loads)
21+
*/
22+
private class DillLoadsCall extends Decoding::Range, DataFlow::CallCfgNode {
23+
DillLoadsCall() { this = API::moduleImport("dill").getMember("loads").getACall() }
1924

20-
override predicate mayExecuteInput() { any() }
25+
override predicate mayExecuteInput() { any() }
2126

22-
override DataFlow::Node getAnInput() { result = this.getArg(0) }
27+
override DataFlow::Node getAnInput() { result = this.getArg(0) }
2328

24-
override DataFlow::Node getOutput() { result = this }
29+
override DataFlow::Node getOutput() { result = this }
2530

26-
override string getFormat() { result = "dill" }
31+
override string getFormat() { result = "dill" }
32+
}
2733
}

0 commit comments

Comments
 (0)