Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85bcaa9

Browse files
Update Concepts.qll
1 parent c22b032 commit 85bcaa9

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,68 @@ private import semmle.python.dataflow.new.RemoteFlowSources
1414
private import semmle.python.dataflow.new.TaintTracking
1515
private import experimental.semmle.python.Frameworks
1616

17+
18+
/** Provides classes for modeling copying file related APIs. */
19+
module CopyFile {
20+
/**
21+
* A data flow node for copying file.
22+
*
23+
* Extend this class to model new APIs. If you want to refine existing API models,
24+
* extend `CopyFile` instead.
25+
*/
26+
abstract class Range extends DataFlow::Node {
27+
/**
28+
* Gets the argument containing the path.
29+
*/
30+
abstract DataFlow::Node getAPathArgument();
31+
}
32+
}
33+
34+
/**
35+
* A data flow node for copying file.
36+
*
37+
* Extend this class to refine existing API models. If you want to model new APIs,
38+
* extend `CopyFile::Range` instead.
39+
*/
40+
class CopyFile extends DataFlow::Node {
41+
CopyFile::Range range;
42+
43+
CopyFile() { this = range }
44+
45+
DataFlow::Node getAPathArgument() { result = range.getAPathArgument() }
46+
}
47+
48+
/** Provides classes for modeling zip related APIs. */
49+
module ZipFile {
50+
/**
51+
* A data flow node for zipfile.
52+
*
53+
* Extend this class to model new APIs. If you want to refine existing API models,
54+
* extend `ZipFile` instead.
55+
*/
56+
abstract class Range extends DataFlow::Node {
57+
/**
58+
* Get the parameter value of the zip function.
59+
*/
60+
abstract DataFlow::Node getAnInput();
61+
62+
}
63+
}
64+
65+
/**
66+
* A data flow node for zip.
67+
*
68+
* Extend this class to refine existing API models. If you want to model new APIs,
69+
* extend `ZipFile::Range` instead.
70+
*/
71+
class ZipFile extends DataFlow::Node {
72+
ZipFile::Range range;
73+
74+
ZipFile() { this = range }
75+
76+
DataFlow::Node getAnInput() { result = range.getAnInput() }
77+
}
78+
1779
/** Provides classes for modeling log related APIs. */
1880
module LogOutput {
1981
/**

0 commit comments

Comments
 (0)