summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@linux.intel.com>2013-06-25 15:41:09 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-25 16:32:08 +0200
commitf12b2300c14c87e2af7397fe39f4b9840fd97212 (patch)
treed3afd6c6d4e1274fae66696406afeb0cab906709 /tools
parent04e9d5867181807acae3b89f8ebc1f517c246933 (diff)
downloadneard-f12b2300c14c87e2af7397fe39f4b9840fd97212.tar.gz
neard-f12b2300c14c87e2af7397fe39f4b9840fd97212.tar.bz2
neard-f12b2300c14c87e2af7397fe39f4b9840fd97212.zip
nfctool: sniffer: Fix ndef read-ahead check macro
This macro checks if we can safely read the next field in a ndef record. So the check needs to be done at the current read position in the current record.
Diffstat (limited to 'tools')
-rw-r--r--tools/nfctool/ndef-decode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/nfctool/ndef-decode.c b/tools/nfctool/ndef-decode.c
index 72f250b..bc891ae 100644
--- a/tools/nfctool/ndef-decode.c
+++ b/tools/nfctool/ndef-decode.c
@@ -226,7 +226,7 @@ int ndef_print_records(guint8 *data, guint32 data_len)
#define CHECK_OFFSET(s) \
do { \
- if (data_len - ndef_offset < (s)) { \
+ if (data_len - (ndef_offset + record_offset) < (s)) { \
ndef_printf_error("Malformed NDEF record"); \
sniffer_print_hexdump(stdout, data, data_len, \
NDEF_HEX_INDENT, TRUE); \