From b016295e9fc8de83a0d36aa6cb066b9075708210 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 6 Dec 2018 15:33:48 +0100 Subject: [PATCH] Return a RunTimeException if the input for the TMD was not valid. --- src/de/mas/wiiu/jnus/entities/TMD.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/de/mas/wiiu/jnus/entities/TMD.java b/src/de/mas/wiiu/jnus/entities/TMD.java index 6037a77..24eaa04 100644 --- a/src/de/mas/wiiu/jnus/entities/TMD.java +++ b/src/de/mas/wiiu/jnus/entities/TMD.java @@ -108,6 +108,9 @@ public final class TMD { } public static TMD parseTMD(byte[] input) { + if (input == null || input.length == 0) { + throw new RuntimeException("Invalid TMD file."); + } byte[] signature = new byte[SIGNATURE_LENGTH]; byte[] issuer = new byte[ISSUER_LENGTH]; byte[] reserved = new byte[RESERVED_LENGTH];