fix
authorChristian Grothoff <christian@grothoff.org>
Thu, 15 Apr 2010 18:53:41 +0000 (18:53 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 15 Apr 2010 18:53:41 +0000 (18:53 +0000)
src/hostlist/hostlist-client.c

index fc100a84ca992d784511ccd852c75c0b8a80b256..8e6850d7e4dc388eec84efa329c7d8dbaff418e9 100644 (file)
@@ -1049,9 +1049,10 @@ load_hostlist_file ()
          (GNUNET_OK == GNUNET_BIO_read_int64 (rh, &created)) &&
          (GNUNET_OK == GNUNET_BIO_read_int32 (rh, &hellos_returned)) )
     {
-      hostlist = GNUNET_malloc ( sizeof (struct Hostlist));
+      hostlist = GNUNET_malloc (sizeof (struct Hostlist) + strlen (uri) + 1);
       hostlist->hello_count = hellos_returned;
-      strcpy(hostlist->hostlist_uri, uri);
+      hostlist->hostlist_uri = (const char *) &hostlist[1];
+      memcpy (&hostlist[1], uri, strlen(uri)+1);
       hostlist->quality = quality;
       hostlist->time_creation.value = created;
       hostlist->time_last_usage.value = last_used;