From 196e2c821225e28f067b26422741659a085e0fd4 Mon Sep 17 00:00:00 2001 From: David Mateos Romero Date: Tue, 27 Feb 2024 15:35:14 +0100 Subject: [PATCH] Prevent shiftAmount overflow --- src/main/java/com/iyxan23/zipalignjava/ZipAlign.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/iyxan23/zipalignjava/ZipAlign.java b/src/main/java/com/iyxan23/zipalignjava/ZipAlign.java index 4b406d8..48fb0c5 100644 --- a/src/main/java/com/iyxan23/zipalignjava/ZipAlign.java +++ b/src/main/java/com/iyxan23/zipalignjava/ZipAlign.java @@ -193,7 +193,7 @@ public static void alignZip(RandomAccessFile file, OutputStream out, int alignme // to keep track of how many bytes we've shifted through the whole file (because we're going to pad null bytes // to align) - short shiftAmount = 0; + int shiftAmount = 0; file.seek(centralDirOffset); byte[] entry = new byte[46]; // not including the filename, extra field, and file comment