aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2023-11-17 01:22:31 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2023-11-17 01:22:31 +0100
commit6b19d6dc3899e1ed5109a6c58f58f970293237a5 (patch)
tree4d5abf6629fa2b60919a3bab906e79a3071935cd
parenta0d5a648861807561ad32bda3ada6b3c0e3ffe4e (diff)
downloadlibgnunetchat-6b19d6dc3899e1ed5109a6c58f58f970293237a5.tar.gz
libgnunetchat-6b19d6dc3899e1ed5109a6c58f58f970293237a5.zip
Fix chat contacts issue with locally unique id
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--src/gnunet_chat_util.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gnunet_chat_util.c b/src/gnunet_chat_util.c
index 0faa331..5ddc824 100644
--- a/src/gnunet_chat_util.c
+++ b/src/gnunet_chat_util.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021--2022 GNUnet e.V. 3 Copyright (C) 2021--2023 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
@@ -30,8 +30,14 @@ util_shorthash_from_member (const struct GNUNET_MESSENGER_Contact *member,
30{ 30{
31 GNUNET_assert(shorthash); 31 GNUNET_assert(shorthash);
32 32
33 const size_t id = GNUNET_MESSENGER_contact_get_id(member);
34
33 memset(shorthash, 0, sizeof(*shorthash)); 35 memset(shorthash, 0, sizeof(*shorthash));
34 GNUNET_memcpy(shorthash, &member, sizeof(member)); 36 GNUNET_memcpy(
37 shorthash,
38 &id,
39 sizeof(id) < sizeof(*shorthash) ? sizeof(id) : sizeof(*shorthash)
40 );
35} 41}
36 42
37void 43void