gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: make gnunet-service-peerinf


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: make gnunet-service-peerinfo unlink HELLOs greater than the allowed GNUNET_MAX_MESSAGE_SIZE
Date: Sun, 17 Dec 2017 18:53:25 +0100

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

xrs pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 2492acd42 make gnunet-service-peerinfo unlink HELLOs greater than the 
allowed GNUNET_MAX_MESSAGE_SIZE
2492acd42 is described below

commit 2492acd4208bf14bf7747d235cfb9971f2cfbf99
Author: xrs <address@hidden>
AuthorDate: Sun Dec 17 18:31:36 2017 +0100

    make gnunet-service-peerinfo unlink HELLOs greater than the allowed 
GNUNET_MAX_MESSAGE_SIZE
---
 src/peerinfo/gnunet-service-peerinfo.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/peerinfo/gnunet-service-peerinfo.c 
b/src/peerinfo/gnunet-service-peerinfo.c
index 731c24bf1..af1eb2d1d 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -987,9 +987,13 @@ discard_hosts_helper (void *cls,
   int write_pos;
   unsigned int cnt;
   char *writebuffer;
+  uint64_t fsize;
 
+  GNUNET_DISK_file_size (fn, &fsize, GNUNET_YES, GNUNET_YES);
   read_size = GNUNET_DISK_fn_read (fn, buffer, sizeof (buffer));
-  if (read_size < (int) sizeof (struct GNUNET_MessageHeader))
+
+  if ((read_size < (int) sizeof (struct GNUNET_MessageHeader)) ||
+      (fsize > GNUNET_MAX_MESSAGE_SIZE))
   {
     if (0 != UNLINK (fn))
       GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING |

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



reply via email to

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