From e1bed6d14b9b43d0751dbce13abae787b75d6768 Mon Sep 17 00:00:00 2001 From: Martin Paljak Date: Wed, 25 Jan 2012 18:06:06 +0200 Subject: [PATCH] apdu_split: correctly handle Le=00 which means 256. --- host/apdu_split.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/apdu_split.c b/host/apdu_split.c index f2cfb7a..4d7bd44 100644 --- a/host/apdu_split.c +++ b/host/apdu_split.c @@ -100,7 +100,7 @@ static void apdu_split_inbyte(struct apdu_split *as, uint8_t ch) break; case APDU_S_P3: apdu_buf_append(as, ch); - as->apdu_data_remaining = ch; + as->apdu_data_remaining = (ch == 0 ? 256 : ch); set_state(as, APDU_S_SW1); break; case APDU_S_DATA: