projects
/
platform
/
upstream
/
neard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04e9d58
)
nfctool: sniffer: Fix ndef read-ahead check macro
author
Thierry Escande
<thierry.escande@linux.intel.com>
Tue, 25 Jun 2013 13:41:09 +0000
(15:41 +0200)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Tue, 25 Jun 2013 14:32:08 +0000
(16:32 +0200)
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.
tools/nfctool/ndef-decode.c
patch
|
blob
|
history
diff --git
a/tools/nfctool/ndef-decode.c
b/tools/nfctool/ndef-decode.c
index
72f250b
..
bc891ae
100644
(file)
--- 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); \