gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 04/05: log precise error if we receive malformed d


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 04/05: log precise error if we receive malformed data
Date: Sun, 22 Jan 2017 23:55:07 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

commit 262926a53f2d8358695d12840a487c3e8e8c4599
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jan 22 23:54:35 2017 +0100

    log precise error if we receive malformed data
---
 src/cadet/gnunet-service-cadet-new.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/cadet/gnunet-service-cadet-new.c 
b/src/cadet/gnunet-service-cadet-new.c
index cb8eab2fe..bb251c307 100644
--- a/src/cadet/gnunet-service-cadet-new.c
+++ b/src/cadet/gnunet-service-cadet-new.c
@@ -632,10 +632,8 @@ check_data (void *cls,
   /* FIXME: what is the format we shall allow for @a msg?
      ONE payload item or multiple? Seems current cadet_api
      at least in theory allows more than one. Next-gen
-     cadet_api will likely no more.
-
-     Regardless, the multi-message check below should pass,
-     albeit it does not :-(. */
+     cadet_api will likely no more, so we could then
+     simplify this mess again. */
   /* Sanity check for message size */
   payload_size = ntohs (msg->header.size) - sizeof (*msg);
   buf = (const char *) &msg[1];
@@ -650,7 +648,13 @@ check_data (void *cls,
          (payload_claimed_size < sizeof (struct GNUNET_MessageHeader)) ||
          (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE < payload_claimed_size) )
     {
-      GNUNET_break_op (0);
+      GNUNET_break (0);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "Local data of %u total size had sub-message %u at %u with %u 
bytes\n",
+           ntohs (msg->header.size),
+           ntohs (pa.type),
+           (unsigned int) (buf - (const char *) &msg[1]),
+           (unsigned int) payload_claimed_size);
       return GNUNET_SYSERR;
     }
     payload_size -= payload_claimed_size;

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



reply via email to

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