summaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-service-messenger_message_store.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/messenger/gnunet-service-messenger_message_store.c')
-rwxr-xr-xsrc/messenger/gnunet-service-messenger_message_store.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/messenger/gnunet-service-messenger_message_store.c b/src/messenger/gnunet-service-messenger_message_store.c
index b143c6c98..1984eba21 100755
--- a/src/messenger/gnunet-service-messenger_message_store.c
+++ b/src/messenger/gnunet-service-messenger_message_store.c
@@ -408,7 +408,8 @@ get_store_message (struct GNUNET_MESSENGER_MessageStore *store, const struct GNU
if (!buffer)
return NULL;
- if (GNUNET_DISK_file_read (store->storage_messages, buffer, entry->length) != entry->length)
+ if ((GNUNET_DISK_file_read (store->storage_messages, buffer, entry->length) != entry->length) ||
+ (entry->length < get_message_kind_size(GNUNET_MESSENGER_KIND_UNKNOWN)))
goto free_buffer;
message = create_message (GNUNET_MESSENGER_KIND_UNKNOWN);