mirror of
https://github.com/bettse/seader.git
synced 2026-06-07 17:32:20 +00:00
Check number of bytes on wire vs length expected
This commit is contained in:
@@ -198,8 +198,13 @@ bool seader_recv_t1(Seader* seader, CCID_Message* message) {
|
||||
uint8_t NAD = message->payload[0];
|
||||
uint8_t rPCB = message->payload[1];
|
||||
uint8_t LEN = message->payload[2];
|
||||
uint8_t LRC = message->payload[3 + LEN];
|
||||
FURI_LOG_D(TAG, "NAD: %02X, rPCB: %02X, LEN: %02X, LRC: %02X", NAD, rPCB, LEN, LRC);
|
||||
//uint8_t LRC = message->payload[3 + LEN];
|
||||
//FURI_LOG_D(TAG, "NAD: %02X, rPCB: %02X, LEN: %02X, LRC: %02X", NAD, rPCB, LEN, LRC);
|
||||
|
||||
if(message->dwLength < (uint32_t)(3 + LEN + 1)) {
|
||||
// incomplete frame
|
||||
return false;
|
||||
}
|
||||
|
||||
if(rPCB == 0xE1) {
|
||||
// S(IFS response)
|
||||
|
||||
Reference in New Issue
Block a user