From: David Barksdale Date: Sat, 23 Sep 2017 16:36:59 +0000 (-0500) Subject: Fix info message header size check X-Git-Tag: gnunet-0.11.0rc0~104^2~27 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=485460866a75569682ee7b8516229002e3271031;p=oweals%2Fgnunet.git Fix info message header size check --- 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, { 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,