use NULL as flag for evaluation of query, ensure we pass non-NULL for reply_block...
authorChristian Grothoff <christian@grothoff.org>
Wed, 1 Feb 2017 15:57:36 +0000 (16:57 +0100)
committerChristian Grothoff <christian@grothoff.org>
Wed, 1 Feb 2017 15:58:28 +0000 (16:58 +0100)
src/dht/gnunet-service-dht_datacache.c
src/dht/plugin_block_dht.c
src/dns/plugin_block_dns.c

index 9b4dace67bca24c3e5750c3b87fe3dbc93c26dc0..74fa1cc29e3cd713b7c7c3ebc2943fbdb497da83 100644 (file)
@@ -170,9 +170,14 @@ datacache_get_iterator (void *cls,
                        unsigned int put_path_length,
                        const struct GNUNET_PeerIdentity *put_path)
 {
+  static char non_null;
   struct GetRequestContext *ctx = cls;
   enum GNUNET_BLOCK_EvaluationResult eval;
 
+  if ( (NULL == data) &&
+       (0 == data_size) )
+    data = &non_null; /* point anywhere, but not to NULL */
+
   eval
     = GNUNET_BLOCK_evaluate (GDS_block_context,
                              type,
index 8bb53396166a36db6a0aebe770f1e91c282e757e..4256a0fe64464bcd0bb0d7fb286d564558469527 100644 (file)
@@ -75,8 +75,7 @@ block_plugin_dht_evaluate (void *cls,
     GNUNET_break_op (0);
     return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
   }
-  if ( (NULL == reply_block) ||
-       (0 == reply_block_size) )
+  if (NULL == reply_block)
     return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
   if (reply_block_size < sizeof (struct GNUNET_MessageHeader))
   {
index dc339dd259e160483b781a8b7a7bfaa013afbdf2..8c6ec93ee2b76e9c0a51411faa97129935913525 100644 (file)
@@ -69,7 +69,7 @@ block_plugin_dns_evaluate (void *cls,
     if (0 != xquery_size)
       return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
 
-    if (0 == reply_block_size)
+    if (NULL == reply_block)
       return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
 
     if (sizeof (struct GNUNET_DNS_Advertisement) != reply_block_size)