Skip to content

Commit 5abb8c9

Browse files
committed
fix ArrayIndexOutOfBoundsException in FileHeaderUtils
1 parent 5f8fd42 commit 5abb8c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/the/bytecode/club/bytecodeviewer/util/FileHeaderUtils.java

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public class FileHeaderUtils
3030

3131
public static boolean doesFileHeaderMatch(byte[] bytes, int fileHeader)
3232
{
33+
if (bytes.length < 4) return false;
34+
3335
int bytesHeader = ((bytes[0] & 0xFF) << 24)
3436
| ((bytes[1] & 0xFF) << 16)
3537
| ((bytes[2] & 0xFF) << 8)

0 commit comments

Comments
 (0)