gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: use NULL as flag for evalua


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: use NULL as flag for evaluation of query, ensure we pass non-NULL for reply_block to evaluate reply even if reply is zero bytes long
Date: Wed, 01 Feb 2017 16:58:21 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 7c8c59699 use NULL as flag for evaluation of query, ensure we pass 
non-NULL for reply_block to evaluate reply even if reply is zero bytes long
7c8c59699 is described below

commit 7c8c596991f6397ec3ca1911638acb2de721c7a7
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Feb 1 16:57:36 2017 +0100

    use NULL as flag for evaluation of query, ensure we pass non-NULL for 
reply_block to evaluate reply even if reply is zero bytes long
---
 src/dht/gnunet-service-dht_datacache.c | 5 +++++
 src/dht/plugin_block_dht.c             | 3 +--
 src/dns/plugin_block_dns.c             | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/dht/gnunet-service-dht_datacache.c 
b/src/dht/gnunet-service-dht_datacache.c
index 9b4dace67..74fa1cc29 100644
--- a/src/dht/gnunet-service-dht_datacache.c
+++ b/src/dht/gnunet-service-dht_datacache.c
@@ -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,
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index 8bb533961..4256a0fe6 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -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))
   {
diff --git a/src/dns/plugin_block_dns.c b/src/dns/plugin_block_dns.c
index dc339dd25..8c6ec93ee 100644
--- a/src/dns/plugin_block_dns.c
+++ b/src/dns/plugin_block_dns.c
@@ -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)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]