aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-03-26 14:05:24 +0100
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-03-26 14:05:24 +0100
commit655fc47e417831125d6ebb5f68d4e86371cb931f (patch)
treebcce16d268e28d6852c86be335b13c5d9e7e93e1
parent83beeae39bf48f3957c80bf0fd03c221bce15bc1 (diff)
downloadgnunet-655fc47e417831125d6ebb5f68d4e86371cb931f.tar.gz
gnunet-655fc47e417831125d6ebb5f68d4e86371cb931f.zip
-more coverity
-rw-r--r--src/arm/arm_api.c8
-rw-r--r--src/cadet/gnunet-service-cadet.c3
-rw-r--r--src/namestore/namestore_api.c6
-rw-r--r--src/revocation/gnunet-service-revocation.c3
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,
951 * 2) We're not connected to ARM. 951 * 2) We're not connected to ARM.
952 * Cancel any reconnection attempts temporarily, then perform 952 * Cancel any reconnection attempts temporarily, then perform
953 * a service test. 953 * a service test.
954 */if (GNUNET_YES == h->currently_up) 954 */
955 if (GNUNET_YES == h->currently_up)
955 { 956 {
956 LOG (GNUNET_ERROR_TYPE_DEBUG, 957 LOG (GNUNET_ERROR_TYPE_DEBUG,
957 "ARM is already running\n"); 958 "ARM is already running\n");
@@ -970,7 +971,8 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
970 yet complete the MQ handshake. However, given that users 971 yet complete the MQ handshake. However, given that users
971 are unlikely to hammer 'gnunet-arm -s' on a busy system, 972 are unlikely to hammer 'gnunet-arm -s' on a busy system,
972 the above check should catch 99.99% of the cases where ARM 973 the above check should catch 99.99% of the cases where ARM
973 is already running. */LOG (GNUNET_ERROR_TYPE_DEBUG, 974 is already running. */
975 LOG (GNUNET_ERROR_TYPE_DEBUG,
974 "Starting ARM service\n"); 976 "Starting ARM service\n");
975 if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE))) 977 if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE)))
976 { 978 {
@@ -1003,13 +1005,13 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
1003 op->rfd, 1005 op->rfd,
1004 &notify_starting, 1006 &notify_starting,
1005 op); 1007 op);
1008 GNUNET_DISK_pipe_close (sig);
1006 } 1009 }
1007 else 1010 else
1008 { 1011 {
1009 op->async = GNUNET_SCHEDULER_add_now (&notify_starting, 1012 op->async = GNUNET_SCHEDULER_add_now (&notify_starting,
1010 op); 1013 op);
1011 } 1014 }
1012 GNUNET_DISK_pipe_close (sig);
1013 return op; 1015 return op;
1014} 1016}
1015 1017
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,
1027 ch = lookup_channel (c, 1027 ch = lookup_channel (c,
1028 message->ccn); 1028 message->ccn);
1029 1029
1030 GCCH_assign_type_to_drop (ch, message); 1030 if (NULL != ch)
1031 GCCH_assign_type_to_drop (ch, message);
1031 1032
1032 GNUNET_SERVICE_client_continue (c->client); 1033 GNUNET_SERVICE_client_continue (c->client);
1033} 1034}
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,
690 690
691 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received ZONE_TO_NAME_RESPONSE\n"); 691 LOG (GNUNET_ERROR_TYPE_DEBUG, "Received ZONE_TO_NAME_RESPONSE\n");
692 qe = find_qe (h, ntohl (msg->gns_header.r_id)); 692 qe = find_qe (h, ntohl (msg->gns_header.r_id));
693 if (NULL == qe)
694 {
695 LOG (GNUNET_ERROR_TYPE_WARNING,
696 "Response queue already gone...\n");
697 return;
698 }
693 res = ntohs (msg->res); 699 res = ntohs (msg->res);
694 switch (res) 700 switch (res)
695 { 701 {
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,
384 uint16_t size; 384 uint16_t size;
385 385
386 size = ntohs (rm->header.size); 386 size = ntohs (rm->header.size);
387 if (size <= sizeof(struct RevokeMessage)) 387 if (size <= sizeof(struct RevokeMessage) ||
388 (size > UINT16_MAX))
388 { 389 {
389 GNUNET_break (0); 390 GNUNET_break (0);
390 return GNUNET_SYSERR; 391 return GNUNET_SYSERR;