diff options
author | David Barksdale <amatus@amat.us> | 2017-09-23 11:36:59 -0500 |
---|---|---|
committer | David Barksdale <amatus@amat.us> | 2017-09-23 11:36:59 -0500 |
commit | 485460866a75569682ee7b8516229002e3271031 (patch) | |
tree | 7e1aa6f9b470de11bb6e2712f6854e66787f1477 /src/peerinfo | |
parent | 67367ce73933cd065f77b176762fb22b3ef849f1 (diff) | |
download | gnunet-485460866a75569682ee7b8516229002e3271031.tar.gz gnunet-485460866a75569682ee7b8516229002e3271031.zip |
Fix info message header size check
Diffstat (limited to 'src/peerinfo')
-rw-r--r-- | src/peerinfo/peerinfo_api.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c index b75d4e291..8b47ed444 100644 --- a/src/peerinfo/peerinfo_api.c +++ b/src/peerinfo/peerinfo_api.c | |||
@@ -334,11 +334,12 @@ handle_info (void *cls, | |||
334 | { | 334 | { |
335 | struct GNUNET_PEERINFO_Handle *h = cls; | 335 | struct GNUNET_PEERINFO_Handle *h = cls; |
336 | struct GNUNET_PEERINFO_IteratorContext *ic = h->ic_head; | 336 | struct GNUNET_PEERINFO_IteratorContext *ic = h->ic_head; |
337 | const struct GNUNET_HELLO_Message *hello; | 337 | const struct GNUNET_HELLO_Message *hello = NULL; |
338 | uint16_t ms; | 338 | uint16_t ms; |
339 | 339 | ||
340 | ms = ntohs (im->header.size); | 340 | ms = ntohs (im->header.size); |
341 | hello = (0 == ms) ? NULL : (const struct GNUNET_HELLO_Message *) &im[1]; | 341 | if (ms > sizeof (struct InfoMessage)) |
342 | hello = (const struct GNUNET_HELLO_Message *) &im[1]; | ||
342 | if (NULL != ic->callback) | 343 | if (NULL != ic->callback) |
343 | ic->callback (ic->callback_cls, | 344 | ic->callback (ic->callback_cls, |
344 | &im->peer, | 345 | &im->peer, |