aboutsummaryrefslogtreecommitdiff
path: root/src/hello
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-02-13 23:49:06 +0000
committerChristian Grothoff <christian@grothoff.org>2010-02-13 23:49:06 +0000
commit3e2673ea17900dc4f078bb8b147678ca66e783d7 (patch)
treea210270d467e6cb582f5ae9dcfff98e22080132c /src/hello
parente4936b6d184608895e10d8e69ffecf8ef7df48f7 (diff)
downloadgnunet-3e2673ea17900dc4f078bb8b147678ca66e783d7.tar.gz
gnunet-3e2673ea17900dc4f078bb8b147678ca66e783d7.zip
permit NULL addrgen
Diffstat (limited to 'src/hello')
-rw-r--r--src/hello/hello.c9
1 files 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
176 176
177 max = sizeof (buffer); 177 max = sizeof (buffer);
178 used = 0; 178 used = 0;
179 while (0 != (ret = addrgen (addrgen_cls, max, &buffer[used]))) 179 if (addrgen != NULL)
180 { 180 {
181 max -= ret; 181 while (0 != (ret = addrgen (addrgen_cls, max, &buffer[used])))
182 used += ret; 182 {
183 max -= ret;
184 used += ret;
185 }
183 } 186 }
184 hello = GNUNET_malloc (sizeof (struct GNUNET_HELLO_Message) + used); 187 hello = GNUNET_malloc (sizeof (struct GNUNET_HELLO_Message) + used);
185 hello->header.type = htons (GNUNET_MESSAGE_TYPE_HELLO); 188 hello->header.type = htons (GNUNET_MESSAGE_TYPE_HELLO);