mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-08-15 16:55:16 +03:00
firmware: sniffer: do not drop maximum-length ATRs
7816-3 8.1/8.2.1 allow TS plus 32 bytes. atr_i is a byte count, not an index, process_byte_atr() guards its own store with the same condition before incrementing, so atr_i reaches 33. Change-Id: Ic8398cbefc0b522946b6470fd0268fa70662dab1
This commit is contained in:
@@ -406,7 +406,7 @@ static void usb_send_atr(uint32_t flags)
|
|||||||
TRACE_WARNING("Can't print ATR in ISO 7816-3 state %u\n\r", iso_state);
|
TRACE_WARNING("Can't print ATR in ISO 7816-3 state %u\n\r", iso_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (g_atr.atr_i >= ARRAY_SIZE(g_atr.atr)) {
|
if (g_atr.atr_i > ARRAY_SIZE(g_atr.atr)) {
|
||||||
TRACE_ERROR("ATR buffer overflow\n\r");
|
TRACE_ERROR("ATR buffer overflow\n\r");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user