File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
python/ql/src/experimental/semmle/python/frameworks Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,18 @@ private import python
2
2
private import experimental.semmle.python.Concepts
3
3
private import semmle.python.dataflow.new.DataFlow
4
4
private import semmle.python.ApiGraphs
5
-
5
+
6
6
private module CopyFile {
7
+
8
+ /**
9
+ * The `shutil` module provides methods to copy or move files.
10
+ * See:
11
+ * - https://docs.python.org/3/library/shutil.html#shutil.copyfile
12
+ * - https://docs.python.org/3/library/shutil.html#shutil.copy
13
+ * - https://docs.python.org/3/library/shutil.html#shutil.copy2
14
+ * - https://docs.python.org/3/library/shutil.html#shutil.copytree
15
+ * - https://docs.python.org/3/library/shutil.html#shutil.move
16
+ */
7
17
private class CopyFiles extends DataFlow::CallCfgNode, CopyFile::Range {
8
18
CopyFiles() {
9
19
this =
@@ -18,7 +28,10 @@ private module CopyFile {
18
28
19
29
override DataFlow::Node getfsrcArgument() { none() }
20
30
}
21
-
31
+
32
+ // TODO: once we have flow summaries, model `shutil.copyfileobj` which copies the content between its' file-like arguments.
33
+ // See https://docs.python.org/3/library/shutil.html#shutil.copyfileobj
34
+
22
35
private class CopyFileobj extends DataFlow::CallCfgNode, CopyFile::Range {
23
36
CopyFileobj() { this = API::moduleImport("shutil").getMember("copyfileobj").getACall() }
24
37
You can’t perform that action at this time.
0 commit comments