diff options
author | Bertrand Marc <beberking@gmail.com> | 2012-06-06 20:47:48 +0200 |
---|---|---|
committer | Bertrand Marc <beberking@gmail.com> | 2012-06-06 20:47:48 +0200 |
commit | 740b30688bd745a527f96f9116c19acb3480971a (patch) | |
tree | 2709a3f4dba11c174aa9e1ba3612e30c578e76a9 /src/dht/plugin_block_dht.c | |
parent | 2b81464a43485fcc8ce079fafdee7b7a171835f4 (diff) |
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'src/dht/plugin_block_dht.c')
-rw-r--r-- | src/dht/plugin_block_dht.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c index 19467b9..3c016ae 100644 --- a/src/dht/plugin_block_dht.c +++ b/src/dht/plugin_block_dht.c @@ -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); |