libgnunetchat

library for GNUnet Messenger
Log | Files | Refs | README | LICENSE

commit bf44309997445537d0a656ec46b17cd737d8371b
parent 8a1cc3a40b6fe2bbbd46e70e46ef7a959d3334e8
Author: Jacki <jacki@thejackimonster.de>
Date:   Sun, 18 Feb 2024 01:28:04 +0100

Safeguard potential issues with updated messages

Signed-off-by: Jacki <jacki@thejackimonster.de>

Diffstat:
Msrc/gnunet_chat_handle_intern.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/gnunet_chat_handle_intern.c b/src/gnunet_chat_handle_intern.c @@ -846,6 +846,10 @@ on_handle_message_callback(void *cls) { case GNUNET_MESSENGER_KIND_INVITE: { + if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains(context->invites, + &(message->hash))) + break; + struct GNUNET_CHAT_Invitation *invitation = invitation_create_from_message( context, &(message->hash), &(message->msg->body.invite) ); @@ -858,6 +862,10 @@ on_handle_message_callback(void *cls) } case GNUNET_MESSENGER_KIND_FILE: { + if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains(context->files, + &(message->hash))) + break; + GNUNET_CONTAINER_multihashmap_put( context->files, &(message->hash), NULL, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST