projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67367ce
)
Fix info message header size check
author
David Barksdale
<amatus@amat.us>
Sat, 23 Sep 2017 16:36:59 +0000
(11:36 -0500)
committer
David Barksdale
<amatus@amat.us>
Sat, 23 Sep 2017 16:36:59 +0000
(11:36 -0500)
src/peerinfo/peerinfo_api.c
patch
|
blob
|
history
diff --git
a/src/peerinfo/peerinfo_api.c
b/src/peerinfo/peerinfo_api.c
index b75d4e2913259fc9583f99aa9226520c0df75371..8b47ed444bb63f4b71a14f8cd2095ab23ad91e2a 100644
(file)
--- a/
src/peerinfo/peerinfo_api.c
+++ b/
src/peerinfo/peerinfo_api.c
@@
-334,11
+334,12
@@
handle_info (void *cls,
{
struct GNUNET_PEERINFO_Handle *h = cls;
struct GNUNET_PEERINFO_IteratorContext *ic = h->ic_head;
- const struct GNUNET_HELLO_Message *hello;
+ const struct GNUNET_HELLO_Message *hello
= NULL
;
uint16_t ms;
ms = ntohs (im->header.size);
- hello = (0 == ms) ? NULL : (const struct GNUNET_HELLO_Message *) &im[1];
+ if (ms > sizeof (struct InfoMessage))
+ hello = (const struct GNUNET_HELLO_Message *) &im[1];
if (NULL != ic->callback)
ic->callback (ic->callback_cls,
&im->peer,