Skip to content

Commit f3ea72c

Browse files
committed
proper tests with depstubber, remove Duplicates :(
1 parent 25c60c4 commit f3ea72c

File tree

11 files changed

+6180
-15
lines changed

11 files changed

+6180
-15
lines changed

go/ql/lib/semmle/go/security/FileSystemAccess.qll

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,6 @@ class AferoSystemAccess extends FileSystemAccess::Range, DataFlow::CallNode {
139139
mcn.hasQualifiedName("github.com/spf13/afero",
140140
["WriteReader", "SafeWriteReader", "WriteFile", "ReadFile", "ReadDir"]) and
141141
this = mcn.getACall()
142-
or
143-
mcn.hasQualifiedName("github.com/spf13/afero", "Open") and
144-
this = mcn.getACall()
145-
)
146-
or
147-
exists(DataFlow::Function mcn |
148-
mcn.hasQualifiedName("github.com/spf13/afero",
149-
["WriteReader", "SafeWriteReader", "WriteFile", "ReadFile", "ReadDir"]) and
150-
this = mcn.getACall()
151-
or
152-
mcn.hasQualifiedName("github.com/spf13/afero", "Open") and
153-
this = mcn.getACall()
154142
)
155143
or
156144
exists(DataFlow::Method mcn |
@@ -189,9 +177,6 @@ class AferoSystemAccess extends FileSystemAccess::Range, DataFlow::CallNode {
189177

190178
override DataFlow::Node getAPathArgument() {
191179
if
192-
this.getTarget()
193-
.hasQualifiedName("github.com/spf13/afero",
194-
["WriteReader", "SafeWriteReader", "WriteFile", "ReadFile", "ReadDir"]) or
195180
this.getTarget()
196181
.hasQualifiedName("github.com/spf13/afero",
197182
["WriteReader", "SafeWriteReader", "WriteFile", "ReadFile", "ReadDir"])
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
| main.go:26:6:26:69 | call to SaveToFileWithBuffer |
2+
| main.go:33:14:33:76 | call to WriteFile |
3+
| main.go:34:16:34:45 | call to ReadFile |
4+
| main.go:41:14:41:49 | call to ReadFile |
5+
| main.go:47:14:47:47 | call to ReadFile |
6+
| main.go:52:14:52:49 | call to ReadFile |
7+
| main.go:57:14:57:52 | call to ReadFile |
8+
| main.go:70:14:70:35 | call to ReadFile |
9+
| main.go:87:10:87:41 | call to File |
10+
| main.go:91:10:91:72 | call to Attachment |
11+
| main.go:100:10:100:29 | call to SendFile |
12+
| main.go:105:7:105:34 | call to SaveFile |
13+
| main.go:106:3:106:24 | call to Attachment |
14+
| main.go:107:10:107:29 | call to SendFile |
15+
| main.go:116:7:116:45 | call to SendFile |
16+
| main.go:117:3:117:32 | call to SendFile |
17+
| main.go:118:3:118:29 | call to SendFileBytes |
18+
| main.go:120:7:120:62 | call to SaveMultipartFile |
19+
| main.go:121:3:121:43 | call to ServeFile |
20+
| main.go:122:3:122:55 | call to ServeFileUncompressed |
21+
| main.go:123:3:123:40 | call to ServeFileBytes |
22+
| main.go:124:3:124:52 | call to ServeFileBytesUncompressed |
23+
| main.go:152:3:152:18 | call to File |
24+
| main.go:153:3:153:47 | call to ServeFile |
25+
| main.go:154:3:154:53 | call to FileAttachment |
26+
| main.go:156:7:156:40 | call to SaveUploadedFile |

0 commit comments

Comments
 (0)