diff options
Diffstat (limited to 'src/consensus/plugin_block_consensus.c')
-rw-r--r-- | src/consensus/plugin_block_consensus.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c index fb6da5bcd..cdac12ed5 100644 --- a/src/consensus/plugin_block_consensus.c +++ b/src/consensus/plugin_block_consensus.c | |||
@@ -58,13 +58,12 @@ block_plugin_consensus_evaluate (void *cls, | |||
58 | const void *reply_block, | 58 | const void *reply_block, |
59 | size_t reply_block_size) | 59 | size_t reply_block_size) |
60 | { | 60 | { |
61 | if (reply_block_size < sizeof(struct ConsensusElement)) | ||
62 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | ||
63 | |||
64 | const struct ConsensusElement *ce = reply_block; | 61 | const struct ConsensusElement *ce = reply_block; |
65 | 62 | ||
66 | if ((0 != ce->marker) || | 63 | if (reply_block_size < sizeof(struct ConsensusElement)) |
67 | (0 == ce->payload_type)) | 64 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
65 | if ( (0 != ce->marker) || | ||
66 | (0 == ce->payload_type) ) | ||
68 | return GNUNET_BLOCK_EVALUATION_OK_MORE; | 67 | return GNUNET_BLOCK_EVALUATION_OK_MORE; |
69 | 68 | ||
70 | return GNUNET_BLOCK_evaluate (ctx, | 69 | return GNUNET_BLOCK_evaluate (ctx, |
@@ -75,8 +74,8 @@ block_plugin_consensus_evaluate (void *cls, | |||
75 | xquery, | 74 | xquery, |
76 | xquery_size, | 75 | xquery_size, |
77 | &ce[1], | 76 | &ce[1], |
78 | reply_block_size - sizeof(struct | 77 | reply_block_size |
79 | ConsensusElement)); | 78 | - sizeof(struct ConsensusElement)); |
80 | } | 79 | } |
81 | 80 | ||
82 | 81 | ||