Skip to content

Commit

Permalink
Prevent shiftAmount overflow (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
iyxan23 authored Feb 28, 2024
2 parents f87cda1 + 196e2c8 commit ca7ba91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/iyxan23/zipalignjava/ZipAlign.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca7ba91

Please sign in to comment.