gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: Fix info message header siz


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: Fix info message header size check
Date: Sat, 23 Sep 2017 18:37:18 +0200

This is an automated email from the git hooks/post-receive script.

david-barksdale pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 485460866 Fix info message header size check
485460866 is described below

commit 485460866a75569682ee7b8516229002e3271031
Author: David Barksdale <address@hidden>
AuthorDate: Sat Sep 23 11:36:59 2017 -0500

    Fix info message header size check
---
 src/peerinfo/peerinfo_api.c | 5 +++--
 1 file 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,
 {
   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,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]