Skip to content

Commit 591b1b4

Browse files
committed
use $ SPURIOUS: instead of "this test gives a FP"
1 parent 9662950 commit 591b1b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

java/ql/test/experimental/query-tests/security/CWE-522-DecompressionBombs/Zip4jHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static void zip4jZipInputStreamSafe(InputStream inputStream) throws IOExc
3333
File extractedFile = new File(localFileHeader.getFileName());
3434
try (OutputStream outputStream = new FileOutputStream(extractedFile)) {
3535
int totallRead = 0;
36-
while ((readLen = zipInputStream.read(readBuffer)) != -1) { // $ hasTaintFlow="zipInputStream" "this test gives a FP"
36+
while ((readLen = zipInputStream.read(readBuffer)) != -1) { // $ SPURIOUS: hasTaintFlow="zipInputStream"
3737
totallRead += readLen;
3838
if (totallRead > 1024 * 1024 * 4) {
3939
System.out.println("potential Bomb");

java/ql/test/experimental/query-tests/security/CWE-522-DecompressionBombs/ZipHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static void ZipInputStreamSafe(InputStream inputStream) throws IOExceptio
3838
}
3939
FileOutputStream fos = new FileOutputStream("/tmp/tmptmp");
4040
BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER);
41-
while (total + BUFFER <= TOOBIG && (count = zis.read(data, 0, BUFFER)) != -1) { // $ hasTaintFlow="zis" "this test gives a FP"
41+
while (total + BUFFER <= TOOBIG && (count = zis.read(data, 0, BUFFER)) != -1) { // $ SPURIOUS: hasTaintFlow="zis"
4242
dest.write(data, 0, count);
4343
total += count;
4444
}
@@ -78,7 +78,7 @@ public static void ZipInputStreamSafe2(InputStream inputStream) throws IOExcepti
7878
}
7979
FileOutputStream fos = new FileOutputStream(entry.getName());
8080
BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER);
81-
while ((count = zis.read(data, 0, BUFFER)) != -1) { // $ hasTaintFlow="zis" "this test gives a FP"
81+
while ((count = zis.read(data, 0, BUFFER)) != -1) { // $ SPURIOUS: hasTaintFlow="zis"
8282
dest.write(data, 0, count);
8383
}
8484
dest.flush();

0 commit comments

Comments
 (0)