From: Christian Grothoff Date: Sun, 22 Jan 2017 22:54:35 +0000 (+0100) Subject: log precise error if we receive malformed data X-Git-Tag: taler-0.2.1~346 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=262926a53f2d8358695d12840a487c3e8e8c4599;p=oweals%2Fgnunet.git log precise error if we receive malformed data --- 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;