From 1db05ed2c6a8393bef9df1a4b59f3635b76d8d6d Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Wed, 5 Jun 2024 22:18:09 +0300 Subject: [PATCH] Revert "add temp fix since no proper fix exist at the moment" This reverts commit 75ece9b697d1e3b66a75f2d423e51f369bc387f1. --- lib/nfc/helpers/iso14443_4_layer.c | 6 +----- lib/toolbox/bit_buffer.c | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/nfc/helpers/iso14443_4_layer.c b/lib/nfc/helpers/iso14443_4_layer.c index 0e742ce95..d53aef64f 100644 --- a/lib/nfc/helpers/iso14443_4_layer.c +++ b/lib/nfc/helpers/iso14443_4_layer.c @@ -66,13 +66,9 @@ bool iso14443_4_layer_decode_block( bool ret = false; - // TODO: Fix properly! this is a very big kostyl na velosipede - // (bit_buffer_copy_right are called to copy bigger buffer into smaller buffer causing crash on furi check) issue comes iso14443_4a_poller_send_block at line 109 - if(bit_buffer_get_size_bytes(output_data) < bit_buffer_get_size_bytes(output_data) - 1) - return ret; - do { if(!bit_buffer_starts_with_byte(block_data, instance->pcb_prev)) break; + // TODO: Fix crash bit_buffer_copy_right(output_data, block_data, 1); ret = true; } while(false); diff --git a/lib/toolbox/bit_buffer.c b/lib/toolbox/bit_buffer.c index 85a52e79d..d8f62ef4c 100644 --- a/lib/toolbox/bit_buffer.c +++ b/lib/toolbox/bit_buffer.c @@ -58,6 +58,7 @@ void bit_buffer_copy_right(BitBuffer* buf, const BitBuffer* other, size_t start_ furi_check(buf); furi_check(other); furi_check(bit_buffer_get_size_bytes(other) > start_index); + // TODO: Fix crash furi_check(buf->capacity_bytes >= bit_buffer_get_size_bytes(other) - start_index); memcpy(buf->data, other->data + start_index, bit_buffer_get_size_bytes(other) - start_index);