diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-02-26 23:12:40 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-02-26 23:12:40 +0100 |
commit | cc8f37a834298d95c233769d19eb9cd17e3dbcfd (patch) | |
tree | 43c926c0025037b1016ef7f6e9ab87fbd34e3e44 /src/consensus/plugin_block_consensus.c | |
parent | e2b2ab728217a64027232c7b8fbbb68ba13edd4a (diff) | |
download | gnunet-cc8f37a834298d95c233769d19eb9cd17e3dbcfd.tar.gz gnunet-cc8f37a834298d95c233769d19eb9cd17e3dbcfd.zip |
fix warning / add size validation for consensus block
Diffstat (limited to 'src/consensus/plugin_block_consensus.c')
-rw-r--r-- | src/consensus/plugin_block_consensus.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c index 399e85feb..39e348b18 100644 --- a/src/consensus/plugin_block_consensus.c +++ b/src/consensus/plugin_block_consensus.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "consensus_protocol.h" | ||
28 | #include "gnunet_block_plugin.h" | 29 | #include "gnunet_block_plugin.h" |
29 | #include "gnunet_block_group_lib.h" | 30 | #include "gnunet_block_group_lib.h" |
30 | 31 | ||
@@ -55,6 +56,10 @@ block_plugin_consensus_evaluate (void *cls, | |||
55 | const void *reply_block, | 56 | const void *reply_block, |
56 | size_t reply_block_size) | 57 | size_t reply_block_size) |
57 | { | 58 | { |
59 | if (reply_block_size < sizeof (struct ConsensusElement)) | ||
60 | { | ||
61 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | ||
62 | } | ||
58 | return GNUNET_BLOCK_EVALUATION_OK_MORE; | 63 | return GNUNET_BLOCK_EVALUATION_OK_MORE; |
59 | } | 64 | } |
60 | 65 | ||