RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
3.81k stars 1.01k forks source link

Fix mf file loading error #2155

Closed henrygab closed 10 months ago

henrygab commented 10 months ago

The code was incorrectly checking the loop variable i, rather than checking the used data length / current buffer pointer.

This causes dumps with all 64 sectors of data to refuse to load, with false error message that the data buffer size was exceeeded.

Also improved flow for dump files, by providing distinct error message when a data block in the JSON ...

Bonus fix for that third case (< 16 bytes):

The old code would save the partial-block into the buffer ... but all future blocks of data would then be loaded at an incorrect offset. The fixed code ensures zero-filled data is used, and this is noticable at the client via the warning message.

github-actions[bot] commented 10 months ago

You are welcome to add an entry to the CHANGELOG.md as well

iceman1001 commented 10 months ago

Nice catches!

Something makes me believe that more json loading parts could use your fixes...