gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated (bec0956da -> 8518546a0)


From: gnunet
Subject: [gnunet] branch master updated (bec0956da -> 8518546a0)
Date: Sun, 29 Sep 2024 16:32:36 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a change to branch master
in repository gnunet.

    from bec0956da build: reduce warnings more
     new baaaf6112 dht: fix regress when fixing warning
     new adf1ecfcc namestore(cli): fix comparison regression against ego name
     new 10f50572e reclaim(cli): fix memory leak
     new 28b57dd8b regex: fix regression from fixing warnings
     new fe63b6117 block: fix parser output to block missing expiration time
     new 8518546a0 hostlist: handle unlikely return code in MHD for coverity

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/cli/namestore/gnunet-namestore.c               |  2 +-
 src/cli/reclaim/gnunet-did.c                       |  5 ++-
 src/lib/hello/hello-uri.c                          |  1 +
 src/service/dht/dht_helper.c                       |  4 +-
 .../hostlist/gnunet-daemon-hostlist_server.c       | 21 +++++----
 src/service/regex/regex_internal.c                 | 50 +++++++++++-----------
 6 files changed, 47 insertions(+), 36 deletions(-)

diff --git a/src/cli/namestore/gnunet-namestore.c 
b/src/cli/namestore/gnunet-namestore.c
index 6f9f501f0..2dc9388d2 100644
--- a/src/cli/namestore/gnunet-namestore.c
+++ b/src/cli/namestore/gnunet-namestore.c
@@ -2071,7 +2071,7 @@ id_connect_cb (void *cls,
                                       ego_tail,
                                       ego_entry);
     if ((NULL != ego_name_tmp) &&
-        (0 == strcmp (ego_name_tmp, ego_name_tmp)))
+        (0 == strcmp (ego_name, ego_name_tmp)))
       zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
     return;
   }
diff --git a/src/cli/reclaim/gnunet-did.c b/src/cli/reclaim/gnunet-did.c
index d0b6c8f26..d68b40b78 100644
--- a/src/cli/reclaim/gnunet-did.c
+++ b/src/cli/reclaim/gnunet-did.c
@@ -380,7 +380,7 @@ create_did_ego_lockup_cb (void *cls, struct 
GNUNET_IDENTITY_Ego *ego)
   else
   {
     char *did_tmp = DID_identity_to_did (ego);
-    void *cls_tmp = malloc (strlen (did_tmp) + 1);
+    void *cls_tmp = GNUNET_malloc (strlen (did_tmp) + 1);
     struct GNUNET_TIME_Relative expire_relative;
 
     if (expire == NULL)
@@ -395,6 +395,7 @@ create_did_ego_lockup_cb (void *cls, struct 
GNUNET_IDENTITY_Ego *ego)
       printf ("Failed to read given expiration time\n");
       GNUNET_SCHEDULER_add_now (cleanup, NULL);
       ret = 1;
+      GNUNET_free (cls_tmp);
       return;
     }
 
@@ -410,8 +411,10 @@ create_did_ego_lockup_cb (void *cls, struct 
GNUNET_IDENTITY_Ego *ego)
       printf ("An error occurred while creating the DID.\n");
       ret = 1;
       GNUNET_SCHEDULER_add_now (&cleanup, NULL);
+      GNUNET_free (cls_tmp);
       return;
     }
+    GNUNET_free (cls_tmp);
   }
 }
 
diff --git a/src/lib/hello/hello-uri.c b/src/lib/hello/hello-uri.c
index 4e39fc496..cfb53131e 100644
--- a/src/lib/hello/hello-uri.c
+++ b/src/lib/hello/hello-uri.c
@@ -1080,6 +1080,7 @@ GNUNET_HELLO_parser_to_block (const struct 
GNUNET_HELLO_Parser *parser,
   }
   bh.pid = parser->pid;
   bh.sig = parser->sig;
+  bh.expiration_time = GNUNET_TIME_absolute_hton (parser->et);
   memcpy (block,
           &bh,
           sizeof (bh));
diff --git a/src/service/dht/dht_helper.c b/src/service/dht/dht_helper.c
index 449ab2a5e..b9480f706 100644
--- a/src/service/dht/dht_helper.c
+++ b/src/service/dht/dht_helper.c
@@ -49,8 +49,8 @@ GDS_helper_put_message_get_size (size_t *msize_out,
 {
   size_t msize;
   const struct GNUNET_DHT_PathElement *put_path_out = put_path_in;
-  bool truncated = (0 != (*ro_out & GNUNET_DHT_RO_TRUNCATED));
-  bool tracking = (0 != (*ro_out & GNUNET_DHT_RO_RECORD_ROUTE));
+  bool truncated = (0 != (ro_in & GNUNET_DHT_RO_TRUNCATED));
+  bool tracking = (0 != (ro_in & GNUNET_DHT_RO_RECORD_ROUTE));
   *put_path_len_out = put_path_len_in;
   *ro_out = ro_in;
 
diff --git a/src/service/hostlist/gnunet-daemon-hostlist_server.c 
b/src/service/hostlist/gnunet-daemon-hostlist_server.c
index 6c062cfcd..a3aa022e1 100644
--- a/src/service/hostlist/gnunet-daemon-hostlist_server.c
+++ b/src/service/hostlist/gnunet-daemon-hostlist_server.c
@@ -154,11 +154,16 @@ static struct HostSet *builder;
 static void
 add_cors_headers (struct MHD_Response *resp)
 {
-  MHD_add_response_header (resp, "Access-Control-Allow-Origin", "*");
-  MHD_add_response_header (resp,
-                           "Access-Control-Allow-Methods",
-                           "GET, OPTIONS");
-  MHD_add_response_header (resp, "Access-Control-Max-Age", "86400");
+  GNUNET_assert (MHD_NO !=
+                 MHD_add_response_header (resp,
+                                          "Access-Control-Allow-Origin", "*"));
+  GNUNET_assert (MHD_NO !=
+                 MHD_add_response_header (resp,
+                                          "Access-Control-Allow-Methods",
+                                          "GET, OPTIONS"));
+  GNUNET_assert (MHD_NO !=
+                 MHD_add_response_header (resp, "Access-Control-Max-Age",
+                                          "86400"));
 }
 
 
@@ -211,9 +216,9 @@ finish_response ()
                                               builder->data,
                                               MHD_RESPMEM_MUST_FREE);
   response_json = build_json_response (builder);
-  MHD_add_response_header (response_json,
-                           "Content-Type",
-                           "application/json");
+  GNUNET_assert (MHD_NO != MHD_add_response_header (response_json,
+                                                    "Content-Type",
+                                                    "application/json"));
   add_cors_headers (response);
   if ((NULL == daemon_handle_v4) && (NULL == daemon_handle_v6))
   {
diff --git a/src/service/regex/regex_internal.c 
b/src/service/regex/regex_internal.c
index 4aeba6fdc..d71638a26 100644
--- a/src/service/regex/regex_internal.c
+++ b/src/service/regex/regex_internal.c
@@ -509,35 +509,37 @@ REGEX_INTERNAL_automaton_traverse (const struct 
REGEX_INTERNAL_Automaton *a,
                                    REGEX_INTERNAL_traverse_action action,
                                    void *action_cls)
 {
-  unsigned int count;
-  int marks[a->state_count];
-  struct REGEX_INTERNAL_State *s;
-
   if ((NULL == a) || (0 == a->state_count))
     return;
 
-
-  for (count = 0, s = a->states_head; NULL != s && count < a->state_count;
-       s = s->next, count++)
   {
-    s->traversal_id = count;
-    marks[s->traversal_id] = GNUNET_NO;
-  }
+    unsigned int count;
+    int marks[a->state_count];
+    struct REGEX_INTERNAL_State *s;
 
-  count = 0;
 
-  if (NULL == start)
-    s = a->start;
-  else
-    s = start;
+    for (count = 0, s = a->states_head; NULL != s && count < a->state_count;
+         s = s->next, count++)
+    {
+      s->traversal_id = count;
+      marks[s->traversal_id] = GNUNET_NO;
+    }
+
+    count = 0;
 
-  automaton_state_traverse (s,
-                            marks,
-                            &count,
-                            check,
-                            check_cls,
-                            action,
-                            action_cls);
+    if (NULL == start)
+      s = a->start;
+    else
+      s = start;
+
+    automaton_state_traverse (s,
+                              marks,
+                              &count,
+                              check,
+                              check_cls,
+                              action,
+                              action_cls);
+  }
 }
 
 
@@ -1136,8 +1138,8 @@ number_states (void *cls,
 
 
 #define PRIS(a)                                     \
-  ((GNUNET_YES == a.null_flag) ? 6 : (int) a.slen), \
-  ((GNUNET_YES == a.null_flag) ? "(null)" : a.sbuf)
+        ((GNUNET_YES == a.null_flag) ? 6 : (int) a.slen), \
+        ((GNUNET_YES == a.null_flag) ? "(null)" : a.sbuf)
 
 
 /**

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]