Prevent integer overflow when checking disk space

This commit is contained in:
Moritz Halbritter 2023-12-12 16:26:25 +01:00
parent 01f59608ac
commit e81d1226fe
2 changed files with 2 additions and 2 deletions

View File

@ -582,7 +582,7 @@ class JarFileTests {
@Test
void zip64JarThatExceedsZipSizeLimitCanBeRead() throws Exception {
Assumptions.assumeTrue(this.tempDir.getFreeSpace() > 6 * 1024 * 1024 * 1024, "Insufficient disk space");
Assumptions.assumeTrue(this.tempDir.getFreeSpace() > 6L * 1024 * 1024 * 1024, "Insufficient disk space");
File zip64Jar = new File(this.tempDir, "zip64.jar");
File entry = new File(this.tempDir, "entry.dat");
CRC32 crc32 = new CRC32();

View File

@ -283,7 +283,7 @@ class ZipContentTests {
@Test
void openWhenZip64ThatExceedsZipSizeLimitOpensZip() throws Exception {
Assumptions.assumeTrue(this.tempDir.getFreeSpace() > 6 * 1024 * 1024 * 1024, "Insufficient disk space");
Assumptions.assumeTrue(this.tempDir.getFreeSpace() > 6L * 1024 * 1024 * 1024, "Insufficient disk space");
File zip64File = new File(this.tempDir, "zip64.zip");
File entryFile = new File(this.tempDir, "entry.dat");
CRC32 crc32 = new CRC32();