aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-02-01 16:57:36 +0100
committerChristian Grothoff <christian@grothoff.org>2017-02-01 16:58:28 +0100
commit7c8c596991f6397ec3ca1911638acb2de721c7a7 (patch)
tree36d91539c3ce9ea38f5e6a91fa0028b3147e521d /src
parent70cf6979e8ee4221b20c00d59b9b30cea8c8ee32 (diff)
downloadgnunet-7c8c596991f6397ec3ca1911638acb2de721c7a7.tar.gz
gnunet-7c8c596991f6397ec3ca1911638acb2de721c7a7.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/dht/gnunet-service-dht_datacache.c5
-rw-r--r--src/dht/plugin_block_dht.c3
-rw-r--r--src/dns/plugin_block_dns.c2
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,
170 unsigned int put_path_length, 170 unsigned int put_path_length,
171 const struct GNUNET_PeerIdentity *put_path) 171 const struct GNUNET_PeerIdentity *put_path)
172{ 172{
173 static char non_null;
173 struct GetRequestContext *ctx = cls; 174 struct GetRequestContext *ctx = cls;
174 enum GNUNET_BLOCK_EvaluationResult eval; 175 enum GNUNET_BLOCK_EvaluationResult eval;
175 176
177 if ( (NULL == data) &&
178 (0 == data_size) )
179 data = &non_null; /* point anywhere, but not to NULL */
180
176 eval 181 eval
177 = GNUNET_BLOCK_evaluate (GDS_block_context, 182 = GNUNET_BLOCK_evaluate (GDS_block_context,
178 type, 183 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,
75 GNUNET_break_op (0); 75 GNUNET_break_op (0);
76 return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID; 76 return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
77 } 77 }
78 if ( (NULL == reply_block) || 78 if (NULL == reply_block)
79 (0 == reply_block_size) )
80 return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; 79 return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
81 if (reply_block_size < sizeof (struct GNUNET_MessageHeader)) 80 if (reply_block_size < sizeof (struct GNUNET_MessageHeader))
82 { 81 {
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,
69 if (0 != xquery_size) 69 if (0 != xquery_size)
70 return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID; 70 return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
71 71
72 if (0 == reply_block_size) 72 if (NULL == reply_block)
73 return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; 73 return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
74 74
75 if (sizeof (struct GNUNET_DNS_Advertisement) != reply_block_size) 75 if (sizeof (struct GNUNET_DNS_Advertisement) != reply_block_size)