From a59ea2ce2b0cfb9c973e81e45b0af4484c6fa7a7 Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Fri, 13 Oct 2023 01:39:25 +0200
Subject: [PATCH] Report incorrect lengths for `0x04` instructions

---
 hwb1/src/hwb1/MyApplet.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hwb1/src/hwb1/MyApplet.java b/hwb1/src/hwb1/MyApplet.java
index 8684bda..4872949 100644
--- a/hwb1/src/hwb1/MyApplet.java
+++ b/hwb1/src/hwb1/MyApplet.java
@@ -70,7 +70,7 @@ public class MyApplet extends Applet {
                         response = storage;
 
                         if (length > response.length) {
-                            length = (short) response.length;
+                            ISOException.throwIt((short)(ISO7816.SW_CORRECT_LENGTH_00 | response.length));
                         }
                     }