X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fhello%2Fhello.c;h=690a0961a34ffaa344277748415c8fe9a2c3db80;hb=7c1f035ed971e12882cd7a65c7d36883842945b1;hp=f9b21aa4f1a58529e68308c3378063c3f36e7e1f;hpb=406c7d2d2d126c994a1fff13470b1f96439c6f9d;p=oweals%2Fgnunet.git diff --git a/src/hello/hello.c b/src/hello/hello.c index f9b21aa4f..690a0961a 100644 --- a/src/hello/hello.c +++ b/src/hello/hello.c @@ -206,7 +206,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, void *addrgen_cls, int friend_only) { - char buffer[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - 256 - + char buffer[GNUNET_MAX_MESSAGE_SIZE - 1 - 256 - sizeof (struct GNUNET_HELLO_Message)]; size_t max; size_t used; @@ -271,7 +271,10 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, msize = GNUNET_HELLO_size (msg); if ((msize < sizeof (struct GNUNET_HELLO_Message)) || (ntohs (msg->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) + { + GNUNET_break_op (0); return NULL; + } ret = NULL; if (return_modified) { @@ -285,6 +288,10 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, wpos = 0; woff = (NULL != ret) ? (char *) &ret[1] : NULL; address.peer.public_key = msg->publicKey; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "HELLO has %u bytes of address data\n", + (unsigned int) insize); + while (insize > 0) { esize = get_hello_address_size (inptr,