File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
java/ql/test/experimental/query-tests/security/CWE-522-DecompressionBombs Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public static void zip4jZipInputStreamSafe(InputStream inputStream) throws IOExc
33
33
File extractedFile = new File (localFileHeader .getFileName ());
34
34
try (OutputStream outputStream = new FileOutputStream (extractedFile )) {
35
35
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"
37
37
totallRead += readLen ;
38
38
if (totallRead > 1024 * 1024 * 4 ) {
39
39
System .out .println ("potential Bomb" );
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public static void ZipInputStreamSafe(InputStream inputStream) throws IOExceptio
38
38
}
39
39
FileOutputStream fos = new FileOutputStream ("/tmp/tmptmp" );
40
40
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"
42
42
dest .write (data , 0 , count );
43
43
total += count ;
44
44
}
@@ -78,7 +78,7 @@ public static void ZipInputStreamSafe2(InputStream inputStream) throws IOExcepti
78
78
}
79
79
FileOutputStream fos = new FileOutputStream (entry .getName ());
80
80
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"
82
82
dest .write (data , 0 , count );
83
83
}
84
84
dest .flush ();
You can’t perform that action at this time.
0 commit comments