diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-18 13:40:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-18 13:40:40 +0000 |
commit | 151053e6aea2c91059843885748bbd10ff183e9b (patch) | |
tree | ad9b4af8febf63ec94fc7fd8208d092281f577a7 /src/dht/plugin_block_dht.c | |
parent | 8dc9e1a5048dd74b1ded7551c9e6120e4c0476a5 (diff) | |
download | gnunet-151053e6aea2c91059843885748bbd10ff183e9b.tar.gz gnunet-151053e6aea2c91059843885748bbd10ff183e9b.zip |
-fixing 2253
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 19467b9c9..3c016aedc 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, | |||
65 | if (type != GNUNET_BLOCK_TYPE_DHT_HELLO) | 65 | if (type != GNUNET_BLOCK_TYPE_DHT_HELLO) |
66 | return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED; | 66 | return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED; |
67 | if (xquery_size != 0) | 67 | if (xquery_size != 0) |
68 | { | ||
69 | GNUNET_break_op (0); | ||
68 | return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID; | 70 | return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID; |
69 | if (reply_block_size == 0) | 71 | } |
72 | if (NULL == reply_block) | ||
70 | return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; | 73 | return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; |
71 | if (reply_block_size < sizeof (struct GNUNET_MessageHeader)) | 74 | if (reply_block_size < sizeof (struct GNUNET_MessageHeader)) |
75 | { | ||
76 | GNUNET_break_op (0); | ||
72 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 77 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
78 | } | ||
73 | msg = reply_block; | 79 | msg = reply_block; |
74 | if (reply_block_size != ntohs (msg->size)) | 80 | if (reply_block_size != ntohs (msg->size)) |
81 | { | ||
82 | GNUNET_break_op (0); | ||
75 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 83 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
84 | } | ||
76 | hello = reply_block; | 85 | hello = reply_block; |
77 | if (GNUNET_OK != GNUNET_HELLO_get_id (hello, &pid)) | 86 | if (GNUNET_OK != GNUNET_HELLO_get_id (hello, &pid)) |
87 | { | ||
88 | GNUNET_break_op (0); | ||
78 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 89 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
90 | } | ||
79 | if (NULL != bf) | 91 | if (NULL != bf) |
80 | { | 92 | { |
81 | GNUNET_BLOCK_mingle_hash (&pid.hashPubKey, bf_mutator, &mhash); | 93 | GNUNET_BLOCK_mingle_hash (&pid.hashPubKey, bf_mutator, &mhash); |