From 17afe7b3d95a4befc769f79c271a4a3361e2b067 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <strilen@tilde.club>
Date: Sun, 29 Jan 2023 05:39:18 -0600
Subject: [PATCH] SETU: put a sensible value in inquiries_sent.

Currently this stuffs the address of an integer-sized stack-allocated variable
into inquiries_sent, which will be irrelevant as soon as the stack frame is
destroyed. It's a pain to allocate an integer-sized region of memory just to
hold a value that's no larger than a pointer, so for now let's use intptr_t to
cast the value. Also, none of these values are currently used.
---
 src/setu/gnunet-service-setu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index ba32af577..ad81dd28d 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -37,6 +37,7 @@
 #include <gcrypt.h>
 #include "gnunet_setu_service.h"
 #include "setu.h"
+#include <stdint.h>
 
 #define LOG(kind, ...) GNUNET_log_from (kind, "setu", __VA_ARGS__)
 
@@ -2917,7 +2918,7 @@ decode_and_send (struct Operation *op)
                                          hashed_key);
       GNUNET_CONTAINER_multihashmap_put (op->inquiries_sent,
                                          hashed_key,
-                                         &mcfs,
+                                         (void *) (intptr_t) mcfs,
                                          GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE
                                          );
 
@@ -3642,7 +3643,7 @@ handle_union_p2p_inquiry (void *cls,
                                      hashed_key);
   GNUNET_CONTAINER_multihashmap_put (op->inquiries_sent,
                                      hashed_key,
-                                     &mcfs,
+                                     (void *) (intptr_t) mcfs,
                                      GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE
                                      );
 
-- 
2.38.1

