diff options
Diffstat (limited to 'src/peerinfo')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 6 |
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 | |