From: Christian Grothoff Date: Wed, 1 Feb 2017 15:57:36 +0000 (+0100) Subject: use NULL as flag for evaluation of query, ensure we pass non-NULL for reply_block... X-Git-Tag: taler-0.2.1~205 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7c8c596991f6397ec3ca1911638acb2de721c7a7;p=oweals%2Fgnunet.git 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 --- 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)