diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-10-25 15:03:01 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-10-25 15:03:01 +0900 |
commit | 3ae41c6868db101c0b7d5cabc0776a376654bf5d (patch) | |
tree | 734e1c75a5ef481a2028a0e4121fdc1141d85575 /src/util | |
parent | 7a1793b347a72ec0b3437effe6faeb4170f1c445 (diff) | |
download | gnunet-3ae41c6868db101c0b7d5cabc0776a376654bf5d.tar.gz gnunet-3ae41c6868db101c0b7d5cabc0776a376654bf5d.zip |
- address coverity findings !coverity
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/client.c | 6 | ||||
-rw-r--r-- | src/util/crypto_hash.c | 3 | ||||
-rw-r--r-- | src/util/gnunet-crypto-tvg.c | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/util/client.c b/src/util/client.c index f4e1b0f56..686e0562a 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -985,9 +985,9 @@ GNUNET_CLIENT_test (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
985 | #if HAVE_SOCKADDR_IN_SUN_LEN | 985 | #if HAVE_SOCKADDR_IN_SUN_LEN |
986 | v4.sin_len = (u_char) sizeof(struct sockaddr_in); | 986 | v4.sin_len = (u_char) sizeof(struct sockaddr_in); |
987 | #endif | 987 | #endif |
988 | inet_pton (AF_INET, | 988 | GNUNET_assert (1 == inet_pton (AF_INET, |
989 | "127.0.0.1", | 989 | "127.0.0.1", |
990 | &v4.sin_addr); | 990 | &v4.sin_addr)); |
991 | ret = GNUNET_NO; | 991 | ret = GNUNET_NO; |
992 | sock = socket (AF_INET, | 992 | sock = socket (AF_INET, |
993 | SOCK_STREAM, | 993 | SOCK_STREAM, |
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index f516f5474..c910eb81c 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c | |||
@@ -316,7 +316,8 @@ GNUNET_CRYPTO_hmac_raw (const void *key, size_t key_len, | |||
316 | { | 316 | { |
317 | gcry_md_reset (md); | 317 | gcry_md_reset (md); |
318 | } | 318 | } |
319 | gcry_md_setkey (md, key, key_len); | 319 | GNUNET_assert (GPG_ERR_NO_ERROR == |
320 | gcry_md_setkey (md, key, key_len)); | ||
320 | gcry_md_write (md, plaintext, plaintext_len); | 321 | gcry_md_write (md, plaintext, plaintext_len); |
321 | mc = gcry_md_read (md, GCRY_MD_SHA512); | 322 | mc = gcry_md_read (md, GCRY_MD_SHA512); |
322 | GNUNET_assert (NULL != mc); | 323 | GNUNET_assert (NULL != mc); |
diff --git a/src/util/gnunet-crypto-tvg.c b/src/util/gnunet-crypto-tvg.c index 76c379784..6ec9229e3 100644 --- a/src/util/gnunet-crypto-tvg.c +++ b/src/util/gnunet-crypto-tvg.c | |||
@@ -640,6 +640,7 @@ checkvec (const char *operation, | |||
640 | GNUNET_free (secret_enc_data); | 640 | GNUNET_free (secret_enc_data); |
641 | GNUNET_free (sig_enc_data); | 641 | GNUNET_free (sig_enc_data); |
642 | GNUNET_free (skey); | 642 | GNUNET_free (skey); |
643 | GNUNET_free (pkey); | ||
643 | GNUNET_break (0); | 644 | GNUNET_break (0); |
644 | return GNUNET_NO; | 645 | return GNUNET_NO; |
645 | } | 646 | } |
@@ -662,6 +663,8 @@ checkvec (const char *operation, | |||
662 | GNUNET_free (secret_enc_data); | 663 | GNUNET_free (secret_enc_data); |
663 | GNUNET_free (sig_enc_data); | 664 | GNUNET_free (sig_enc_data); |
664 | GNUNET_free (skey); | 665 | GNUNET_free (skey); |
666 | GNUNET_free (sig); | ||
667 | GNUNET_free (pkey); | ||
665 | GNUNET_break (0); | 668 | GNUNET_break (0); |
666 | return GNUNET_NO; | 669 | return GNUNET_NO; |
667 | } | 670 | } |
@@ -670,6 +673,8 @@ checkvec (const char *operation, | |||
670 | GNUNET_free (public_enc_data); | 673 | GNUNET_free (public_enc_data); |
671 | GNUNET_free (secret_enc_data); | 674 | GNUNET_free (secret_enc_data); |
672 | GNUNET_free (sig_enc_data); | 675 | GNUNET_free (sig_enc_data); |
676 | GNUNET_free (sig); | ||
677 | GNUNET_free (pkey); | ||
673 | GNUNET_free (skey); | 678 | GNUNET_free (skey); |
674 | } | 679 | } |
675 | else if (0 == strcmp (operation, "cs_blind_signing")) | 680 | else if (0 == strcmp (operation, "cs_blind_signing")) |