assert
authorChristian Grothoff <christian@grothoff.org>
Tue, 15 Mar 2011 10:31:34 +0000 (10:31 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 15 Mar 2011 10:31:34 +0000 (10:31 +0000)
src/fs/gnunet-service-fs_cp.c

index 4d1cba508e83d41864f1bfcb6ac8c87d8b3ddf0d..16ff566b2f49ac06bb2d2534bba44c66ad463827 100644 (file)
@@ -592,7 +592,7 @@ handle_p2p_reply (void *cls,
                                                          &prd->query,
                                                          pr));
       return;
-    }
+    }  
 #if DEBUG_FS
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Transmitting result for query `%s'\n",
@@ -603,6 +603,11 @@ handle_p2p_reply (void *cls,
                            1,
                            GNUNET_NO); 
   msize = sizeof (struct PutMessage) + data_len;
+  if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+    {
+      GNUNET_break (0);
+      return;
+    }
   pm = GNUNET_malloc (sizeof (msize));
   pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
   pm->header.size = htons (msize);