diff options
author | Martijn Coenen <maco@google.com> | 2016-07-20 09:11:15 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-07-20 09:11:15 +0000 |
commit | 95dfb6957a472bb395d5b413877e34350eb9cd4a (patch) | |
tree | 2748a611ca4c928cacfca02ca6dc1c4636241949 | |
parent | 1d38b130f3c88f16ee6ca12c58c31b1066bb0f58 (diff) | |
parent | 400d445b8fc35f9f15a037f8bf610ca3352e3f5f (diff) | |
download | libnfc-nci-95dfb6957a472bb395d5b413877e34350eb9cd4a.tar.gz |
Merge "Fix crash issue on reading ISO-15693 tag with more than 255 bytes NDef message."
-rw-r--r-- | src/nfc/tags/rw_i93.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nfc/tags/rw_i93.c b/src/nfc/tags/rw_i93.c index acdbcb7..cec6af9 100644 --- a/src/nfc/tags/rw_i93.c +++ b/src/nfc/tags/rw_i93.c @@ -1997,6 +1997,11 @@ void rw_i93_sm_read_ndef (BT_HDR *p_resp) p_i93->rw_length += p_resp->len; } + else + { + /* in case of no Ndef data included */ + p_resp->len = 0; + } /* if read all of NDEF data */ if (p_i93->rw_length >= p_i93->ndef_length) @@ -2019,7 +2024,10 @@ void rw_i93_sm_read_ndef (BT_HDR *p_resp) p_resp->len, p_i93->ndef_length); - (*(rw_cb.p_cback)) (RW_I93_NDEF_READ_EVT, &rw_data); + if (p_resp->len > 0) + { + (*(rw_cb.p_cback)) (RW_I93_NDEF_READ_EVT, &rw_data); + } /* this will make read data from next block */ p_i93->rw_offset += length; |