aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo
diff options
context:
space:
mode:
authorxrs <xrs@mail36.net>2017-12-17 18:31:36 +0100
committerxrs <xrs@mail36.net>2017-12-17 18:31:36 +0100
commit2492acd4208bf14bf7747d235cfb9971f2cfbf99 (patch)
tree63638f6fe18c72a955f62e0fd896e5e682ebfd9c /src/peerinfo
parent131ee76018de55c0d87d6928fb29e8b965403eef (diff)
downloadgnunet-2492acd4208bf14bf7747d235cfb9971f2cfbf99.tar.gz
gnunet-2492acd4208bf14bf7747d235cfb9971f2cfbf99.zip
make gnunet-service-peerinfo unlink HELLOs greater than the allowed GNUNET_MAX_MESSAGE_SIZE
Diffstat (limited to 'src/peerinfo')
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c6
1 files changed, 5 insertions, 1 deletions
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,
987 int write_pos; 987 int write_pos;
988 unsigned int cnt; 988 unsigned int cnt;
989 char *writebuffer; 989 char *writebuffer;
990 uint64_t fsize;
990 991
992 GNUNET_DISK_file_size (fn, &fsize, GNUNET_YES, GNUNET_YES);
991 read_size = GNUNET_DISK_fn_read (fn, buffer, sizeof (buffer)); 993 read_size = GNUNET_DISK_fn_read (fn, buffer, sizeof (buffer));
992 if (read_size < (int) sizeof (struct GNUNET_MessageHeader)) 994
995 if ((read_size < (int) sizeof (struct GNUNET_MessageHeader)) ||
996 (fsize > GNUNET_MAX_MESSAGE_SIZE))
993 { 997 {
994 if (0 != UNLINK (fn)) 998 if (0 != UNLINK (fn))
995 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING | 999 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING |