From e5147f44094c71362216f3b34b7c8cfcefd67d38 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 19 Aug 2013 16:40:59 +0200 Subject: [PATCH] nfctype1: Use the right offset after the CC The Capability container is 4 bytes long and the NDEF data can be found right after that. The offset for the static memory on a dynamic tag should thus be the length of the CC and not more. --- plugins/nfctype1.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/nfctype1.c b/plugins/nfctype1.c index 553f0e0..c1469c1 100644 --- a/plugins/nfctype1.c +++ b/plugins/nfctype1.c @@ -200,7 +200,6 @@ static int read_dynamic_tag(uint8_t *cc, int length, void *data) { struct type1_tag *t1_tag = data; struct type1_cmd t1_cmd; - uint8_t *tagdata; uint8_t *pndef; size_t data_length; @@ -209,10 +208,8 @@ static int read_dynamic_tag(uint8_t *cc, int length, void *data) tagdata = near_tag_get_data(t1_tag->tag, &data_length); - /* Skip un-needed bytes */ + /* Skip capability container bytes */ pndef = cc + 4; /* right after CC bytes */ - pndef = pndef + 5; /* skip TLV Lock bits bytes */ - pndef = pndef + 5; /* skip TLV ControlIT bytes */ /* * Save first NFC bytes to tag memory @@ -242,7 +239,6 @@ static int meta_recv(uint8_t *resp, int length, void *data) struct t1_cookie *cookie = data; struct near_tag *tag; struct type1_tag *t1_tag; - uint8_t *cc; int err = -EOPNOTSUPP; -- 2.7.4