gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: fix warning / add size vali


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: fix warning / add size validation for consensus block
Date: Sun, 26 Feb 2017 23:12:44 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new cc8f37a83 fix warning / add size validation for consensus block
cc8f37a83 is described below

commit cc8f37a834298d95c233769d19eb9cd17e3dbcfd
Author: Florian Dold <address@hidden>
AuthorDate: Sun Feb 26 23:12:40 2017 +0100

    fix warning / add size validation for consensus block
---
 src/consensus/consensus_protocol.h     | 1 +
 src/consensus/plugin_block_consensus.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/consensus/consensus_protocol.h 
b/src/consensus/consensus_protocol.h
index 101b8aee7..161c939cd 100644
--- a/src/consensus/consensus_protocol.h
+++ b/src/consensus/consensus_protocol.h
@@ -29,6 +29,7 @@
 #define GNUNET_CONSENSUS_PROTOCOL_H
 
 #include "platform.h"
+#include "gnunet_util_lib.h"
 #include "gnunet_common.h"
 #include "gnunet_protocols.h"
 
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 @@
  */
 
 #include "platform.h"
+#include "consensus_protocol.h"
 #include "gnunet_block_plugin.h"
 #include "gnunet_block_group_lib.h"
 
@@ -55,6 +56,10 @@ block_plugin_consensus_evaluate (void *cls,
                                  const void *reply_block,
                                  size_t reply_block_size)
 {
+  if (reply_block_size < sizeof (struct ConsensusElement))
+  {
+    return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
+  }
   return GNUNET_BLOCK_EVALUATION_OK_MORE;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]