-fix
[oweals/gnunet.git] / src / dht / plugin_block_dht.c
index f574e6d0643245042aa56a762701109f4100ccb5..3c016aedcdb3b14ff839e3ac644eb01af4be1d68 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 /**
- * @file block/plugin_block_dht.c
+ * @file dht/plugin_block_dht.c
  * @brief block plugin for DHT internals (right now, find-peer requests only);
  *        other plugins should be used to store "useful" data in the
  *        DHT (see fs block plugin)
@@ -65,17 +65,29 @@ block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
   if (type != GNUNET_BLOCK_TYPE_DHT_HELLO)
     return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
   if (xquery_size != 0)
+  {
+    GNUNET_break_op (0);
     return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
-  if (reply_block_size == 0)
+  }
+  if (NULL == reply_block)
     return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
   if (reply_block_size < sizeof (struct GNUNET_MessageHeader))
+  {
+    GNUNET_break_op (0);
     return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
+  }
   msg = reply_block;
   if (reply_block_size != ntohs (msg->size))
+  {
+    GNUNET_break_op (0);
     return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
+  }
   hello = reply_block;
   if (GNUNET_OK != GNUNET_HELLO_get_id (hello, &pid))
+  {
+    GNUNET_break_op (0);
     return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
+  }
   if (NULL != bf)
   {
     GNUNET_BLOCK_mingle_hash (&pid.hashPubKey, bf_mutator, &mhash);