fix
authorChristian Grothoff <christian@grothoff.org>
Mon, 12 Apr 2010 11:35:33 +0000 (11:35 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 12 Apr 2010 11:35:33 +0000 (11:35 +0000)
src/hostlist/hostlist-client.c
src/hostlist/hostlist-server.c

index 3824972d86eba1dc5c283ca7d447dc80b7631fe0..b63644b41da53260a59b4b80174de7d348a69842 100644 (file)
@@ -151,11 +151,10 @@ download_hostlist_processor (void *ptr,
   while ( (left > 0) ||
          (download_pos > 0) )
     {
-      cpy = GNUNET_MIN (total, GNUNET_SERVER_MAX_MESSAGE_SIZE - download_pos);
-      GNUNET_assert (cpy > 0);
+      cpy = GNUNET_MIN (left, GNUNET_SERVER_MAX_MESSAGE_SIZE - download_pos);
       memcpy (&download_buffer[download_pos],
              cbuf,
-             cpy);
+             cpy);      
       cbuf += cpy;
       download_pos += cpy;
       left -= cpy;
index 6b35269269e450b33a6f22698a7931b8d4ebfebf..2d0210cab93b566c1dacbc9fb76f6d7012e7fdd0 100644 (file)
@@ -206,6 +206,8 @@ host_processor (void *cls,
       finish_response (results);
       return;
     }
+  if (hello == NULL)
+    return;
   has_addr = GNUNET_NO;
   GNUNET_HELLO_iterate_addresses (hello,
                                  GNUNET_NO,