From 3e2673ea17900dc4f078bb8b147678ca66e783d7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 13 Feb 2010 23:49:06 +0000 Subject: [PATCH] permit NULL addrgen --- src/hello/hello.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hello/hello.c b/src/hello/hello.c index a7aaf7d54..2a99234db 100644 --- a/src/hello/hello.c +++ b/src/hello/hello.c @@ -176,10 +176,13 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded max = sizeof (buffer); used = 0; - while (0 != (ret = addrgen (addrgen_cls, max, &buffer[used]))) + if (addrgen != NULL) { - max -= ret; - used += ret; + while (0 != (ret = addrgen (addrgen_cls, max, &buffer[used]))) + { + max -= ret; + used += ret; + } } hello = GNUNET_malloc (sizeof (struct GNUNET_HELLO_Message) + used); hello->header.type = htons (GNUNET_MESSAGE_TYPE_HELLO); -- 2.25.1