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
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" );
Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments