gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: -more coverity


From: gnunet
Subject: [gnunet] branch master updated: -more coverity
Date: Fri, 26 Mar 2021 14:07:10 +0100

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 655fc47e4 -more coverity
655fc47e4 is described below

commit 655fc47e417831125d6ebb5f68d4e86371cb931f
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Fri Mar 26 14:05:24 2021 +0100

    -more coverity
---
 src/arm/arm_api.c                          | 8 +++++---
 src/cadet/gnunet-service-cadet.c           | 3 ++-
 src/namestore/namestore_api.c              | 6 ++++++
 src/revocation/gnunet-service-revocation.c | 3 ++-
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index 899b6f152..2ec913a0a 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -951,7 +951,8 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle 
*h,
    * 2) We're not connected to ARM.
    *    Cancel any reconnection attempts temporarily, then perform
    *    a service test.
-   */if (GNUNET_YES == h->currently_up)
+   */
+  if (GNUNET_YES == h->currently_up)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "ARM is already running\n");
@@ -970,7 +971,8 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle 
*h,
      yet complete the MQ handshake.  However, given that users
      are unlikely to hammer 'gnunet-arm -s' on a busy system,
      the above check should catch 99.99% of the cases where ARM
-     is already running. */LOG (GNUNET_ERROR_TYPE_DEBUG,
+     is already running. */
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Starting ARM service\n");
   if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE)))
   {
@@ -1003,13 +1005,13 @@ GNUNET_ARM_request_service_start (struct 
GNUNET_ARM_Handle *h,
                                                 op->rfd,
                                                 &notify_starting,
                                                 op);
+    GNUNET_DISK_pipe_close (sig);
   }
   else
   {
     op->async = GNUNET_SCHEDULER_add_now (&notify_starting,
                                           op);
   }
-  GNUNET_DISK_pipe_close (sig);
   return op;
 }
 
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c
index 2d3b548dd..c8d69e43d 100644
--- a/src/cadet/gnunet-service-cadet.c
+++ b/src/cadet/gnunet-service-cadet.c
@@ -1027,7 +1027,8 @@ handle_drop_message (void *cls,
   ch = lookup_channel (c,
                        message->ccn);
 
-  GCCH_assign_type_to_drop (ch, message);
+  if (NULL != ch)
+    GCCH_assign_type_to_drop (ch, message);
 
   GNUNET_SERVICE_client_continue (c->client);
 }
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index c845b5019..2d5327e06 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -690,6 +690,12 @@ handle_zone_to_name_response (void *cls,
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Received ZONE_TO_NAME_RESPONSE\n");
   qe = find_qe (h, ntohl (msg->gns_header.r_id));
+  if (NULL == qe)
+  {
+    LOG (GNUNET_ERROR_TYPE_WARNING,
+         "Response queue already gone...\n");
+    return;
+  }
   res = ntohs (msg->res);
   switch (res)
   {
diff --git a/src/revocation/gnunet-service-revocation.c 
b/src/revocation/gnunet-service-revocation.c
index 863289aae..7032921c6 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -384,7 +384,8 @@ check_revoke_message (void *cls,
   uint16_t size;
 
   size = ntohs (rm->header.size);
-  if (size <= sizeof(struct RevokeMessage))
+  if (size <= sizeof(struct RevokeMessage) ||
+      (size > UINT16_MAX))
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;

-- 
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]