From 129d6f1e6df80113d32f832ce16b5462c8732328 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 5 Sep 2024 17:59:34 +0200 Subject: [PATCH] a bit untested, I am sure all standalone modes fails now. lets see if this is enough of bounds checking --- CHANGELOG.md | 1 + armsrc/iso14443a.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cb3137d1..facb6ee75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Fixed ISO14443a bounds-checking because @doegex found cards not following ISO14443a when fuzzed (@iceman1001) - Added `mfkey32nested`: recovering partial nested authentication with known nT (@doegox) - Added support for dumping FM11RF08S data at once (@doegox) - Added support for collecting all FM11RF08S nT/{nT}/par_err at once (@doegox) diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index ef8bea8c3..eda9a152d 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -483,6 +483,11 @@ void Demod14aInit(uint8_t *d, uint16_t n, uint8_t *par) { // use parameter non_real_time to provide a timestamp. Set to 0 if the decoder should measure real time RAMFUNC int ManchesterDecoding(uint8_t bit, uint16_t offset, uint32_t non_real_time) { + + if (Demod.len == Demod.output_len - 1) { + return true; + } + Demod.twoBits = (Demod.twoBits << 8) | bit; if (Demod.state == DEMOD_14A_UNSYNCD) {