Skip to content

Commit 7dee22a

Browse files
committed
Fix implicit 'this' usage
1 parent eee521e commit 7dee22a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private class MethodFileDirectoryCreation extends MethodFileSystemFileCreation {
2424
}
2525

2626
private class MethodFileFileCreation extends MethodFileSystemFileCreation {
27-
MethodFileFileCreation() { this.hasName(["createNewFile"]) }
27+
MethodFileFileCreation() { this.hasName("createNewFile") }
2828
}
2929

3030
abstract private class FileCreationSink extends DataFlow::Node { }
@@ -191,7 +191,7 @@ class MethodAccessInsecureFileCreateTempFile extends MethodAccessInsecureFileCre
191191
this.getNumArgument() = 2
192192
or
193193
// The default temporary directory is used when the last argument of `File.createTempFile(string, string, File)` is `null`
194-
DataFlow::localExprFlow(any(NullLiteral n), getArgument(2))
194+
DataFlow::localExprFlow(any(NullLiteral n), this.getArgument(2))
195195
)
196196
}
197197

@@ -203,8 +203,8 @@ class MethodAccessInsecureFileCreateTempFile extends MethodAccessInsecureFileCre
203203
*/
204204
class MethodGuavaFilesCreateTempFile extends Method {
205205
MethodGuavaFilesCreateTempFile() {
206-
getDeclaringType().hasQualifiedName("com.google.common.io", "Files") and
207-
hasName("createTempDir")
206+
this.getDeclaringType().hasQualifiedName("com.google.common.io", "Files") and
207+
this.hasName("createTempDir")
208208
}
209209
}
210210

@@ -213,14 +213,14 @@ class MethodGuavaFilesCreateTempFile extends Method {
213213
*/
214214
class MethodAccessInsecureGuavaFilesCreateTempFile extends MethodAccessInsecureFileCreation {
215215
MethodAccessInsecureGuavaFilesCreateTempFile() {
216-
getMethod() instanceof MethodGuavaFilesCreateTempFile
216+
this.getMethod() instanceof MethodGuavaFilesCreateTempFile
217217
}
218218

219219
override string getFileSystemEntityType() { result = "directory" }
220220
}
221221

222222
/**
223-
* This is a hack: we include use of inherently insecure methods, which don't have any associated
223+
* A hack: we include use of inherently insecure methods, which don't have any associated
224224
* flow path, in with results describing a path from reading `java.io.tmpdir` or similar to use
225225
* in a file creation op.
226226
*

0 commit comments

Comments
 (0)