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:
a3a8c02
)
nfctool: Fix snep-decode potential overflow
author
Samuel Ortiz
<sameo@linux.intel.com>
Mon, 4 Nov 2013 23:48:24 +0000
(
00:48
+0100)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Wed, 20 Nov 2013 00:06:31 +0000
(
01:06
+0100)
Code review done by Sebastian Krahmer <krahmer@suse.de>.
tools/nfctool/snep-decode.c
patch
|
blob
|
history
diff --git
a/tools/nfctool/snep-decode.c
b/tools/nfctool/snep-decode.c
index
27d3c1e
..
bee06e5
100644
(file)
--- a/
tools/nfctool/snep-decode.c
+++ b/
tools/nfctool/snep-decode.c
@@
-159,6
+159,8
@@
static int snep_decode_info(struct sniffer_packet *packet)
}
frag = g_malloc(sizeof(struct snep_frag));
+ if (!frag)
+ return -ENOMEM;
frag->count = 1;
@@
-167,6
+169,8
@@
static int snep_decode_info(struct sniffer_packet *packet)
frag->received = packet->snep.real_len;
frag->buffer = g_malloc0(frag->buffer_size);
+ if (!frag->buffer)
+ return -ENOMEM;
memcpy(frag->buffer, packet->snep.data, packet->snep.real_len);