aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-10-25 15:03:01 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-10-25 15:03:01 +0900
commit3ae41c6868db101c0b7d5cabc0776a376654bf5d (patch)
tree734e1c75a5ef481a2028a0e4121fdc1141d85575 /src/namestore
parent7a1793b347a72ec0b3437effe6faeb4170f1c445 (diff)
downloadgnunet-3ae41c6868db101c0b7d5cabc0776a376654bf5d.tar.gz
gnunet-3ae41c6868db101c0b7d5cabc0776a376654bf5d.zip
- address coverity findings !coverity
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore-zonefile.c8
-rw-r--r--src/namestore/gnunet-namestore.c4
-rw-r--r--src/namestore/gnunet-service-namestore.c5
3 files changed, 11 insertions, 6 deletions
diff --git a/src/namestore/gnunet-namestore-zonefile.c b/src/namestore/gnunet-namestore-zonefile.c
index ff3b2a565..8820dcdfa 100644
--- a/src/namestore/gnunet-namestore-zonefile.c
+++ b/src/namestore/gnunet-namestore-zonefile.c
@@ -405,7 +405,9 @@ parse (void *cls)
405 if (NULL == next) 405 if (NULL == next)
406 { 406 {
407 fprintf (stderr, "Error at line %u: %s\n", ln, token); 407 fprintf (stderr, "Error at line %u: %s\n", ln, token);
408 break; 408 ret = 1;
409 GNUNET_SCHEDULER_shutdown ();
410 return;
409 } 411 }
410 next[0] = '\0'; 412 next[0] = '\0';
411 next++; 413 next++;
@@ -493,7 +495,7 @@ parse (void *cls)
493 { 495 {
494 if (GNUNET_SYSERR == parse_ttl (token, &ttl)) 496 if (GNUNET_SYSERR == parse_ttl (token, &ttl))
495 { 497 {
496 fprintf (stderr, _("Failed to parse $TTL\n")); 498 fprintf (stderr, _ ("Failed to parse $TTL\n"));
497 ret = 1; 499 ret = 1;
498 GNUNET_SCHEDULER_shutdown (); 500 GNUNET_SCHEDULER_shutdown ();
499 return; 501 return;
@@ -504,7 +506,7 @@ parse (void *cls)
504 { 506 {
505 if (GNUNET_SYSERR == parse_origin (token, origin)) 507 if (GNUNET_SYSERR == parse_origin (token, origin))
506 { 508 {
507 fprintf (stderr, _("Failed to parse $ORIGIN from %s\n"), token); 509 fprintf (stderr, _ ("Failed to parse $ORIGIN from %s\n"), token);
508 ret = 1; 510 ret = 1;
509 GNUNET_SCHEDULER_shutdown (); 511 GNUNET_SCHEDULER_shutdown ();
510 return; 512 return;
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index f6e53a340..d6154f0aa 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -614,7 +614,6 @@ display_record (const struct GNUNET_IDENTITY_PrivateKey *zone_key,
614 const char *typestr; 614 const char *typestr;
615 char *s; 615 char *s;
616 const char *ets; 616 const char *ets;
617 struct GNUNET_IDENTITY_PublicKey pk;
618 struct GNUNET_TIME_Absolute at; 617 struct GNUNET_TIME_Absolute at;
619 struct GNUNET_TIME_Relative rt; 618 struct GNUNET_TIME_Relative rt;
620 struct EgoEntry *ego; 619 struct EgoEntry *ego;
@@ -651,8 +650,7 @@ display_record (const struct GNUNET_IDENTITY_PrivateKey *zone_key,
651 return; 650 return;
652 if (! list_orphaned && is_orphaned) 651 if (! list_orphaned && is_orphaned)
653 return; 652 return;
654 GNUNET_IDENTITY_key_get_public (zone_key, &pk); 653 orphaned_str = GNUNET_IDENTITY_private_key_to_string (zone_key);
655 orphaned_str = GNUNET_IDENTITY_public_key_to_string (&pk);
656 fprintf (stdout, "%s.%s:\n", rname, is_orphaned ? orphaned_str : 654 fprintf (stdout, "%s.%s:\n", rname, is_orphaned ? orphaned_str :
657 ego->identifier); 655 ego->identifier);
658 GNUNET_free (orphaned_str); 656 GNUNET_free (orphaned_str);
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index b3c077141..92c81c4eb 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -752,7 +752,11 @@ send_lookup_response_with_filter (struct NamestoreClient *nc,
752 GNUNET_free (nick); 752 GNUNET_free (nick);
753 753
754 if (0 == res_count) 754 if (0 == res_count)
755 {
756 if (rd_nf != res)
757 GNUNET_free (res);
755 return 0; 758 return 0;
759 }
756 GNUNET_assert (-1 != GNUNET_GNSRECORD_records_get_size (res_count, res)); 760 GNUNET_assert (-1 != GNUNET_GNSRECORD_records_get_size (res_count, res));
757 761
758 762
@@ -1573,6 +1577,7 @@ store_record_set (struct NamestoreClient *nc,
1573 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1577 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1574 "Name `%s' does not exist, no deletion required\n", 1578 "Name `%s' does not exist, no deletion required\n",
1575 conv_name); 1579 conv_name);
1580 res = GNUNET_NO;
1576 ec = GNUNET_EC_NAMESTORE_RECORD_NOT_FOUND; 1581 ec = GNUNET_EC_NAMESTORE_RECORD_NOT_FOUND;
1577 } 1582 }
1578 else 1583 else