fix
authorChristian Grothoff <christian@grothoff.org>
Sun, 27 Mar 2011 14:26:14 +0000 (14:26 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 27 Mar 2011 14:26:14 +0000 (14:26 +0000)
src/fs/gnunet-service-fs_cp.c

index 80b9c4f1151af75ef10eb742789606953401b1a5..eec4adeea805f6b23946702b8ef24c5e78c2cde4 100644 (file)
@@ -630,6 +630,7 @@ handle_p2p_reply (void *cls,
   struct PutMessage *pm;
   size_t msize;
 
+  GNUNET_assert (data_len < GNUNET_SERVER_MAX_MESSAGE_SIZE);
   prd = GSF_pending_request_get_data_ (pr);
   if (NULL == data)
     {
@@ -665,7 +666,7 @@ handle_p2p_reply (void *cls,
       GNUNET_break (0);
       return;
     }
-  pm = GNUNET_malloc (sizeof (msize));
+  pm = GNUNET_malloc (msize);
   pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
   pm->header.size = htons (msize);
   pm->type = htonl (type);