gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated (3dd913ec -> 91ef87a


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated (3dd913ec -> 91ef87a8)
Date: Mon, 03 Jun 2019 11:17:43 +0200

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

grothoff pushed a change to branch master
in repository exchange.

    from 3dd913ec put fixme for #5746.
     new 256910e2 getchar() result is intentionally discarded, make this clear
     new 91ef87a8 fix potential free of uninitialized ptr, (on virtually 
impossible error handling path)

The 2 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/benchmark/taler-exchange-benchmark.c |  4 ++--
 src/lib/exchange_api_refresh.c           | 23 ++++++++++++-----------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/benchmark/taler-exchange-benchmark.c 
b/src/benchmark/taler-exchange-benchmark.c
index 836e1cfc..c90ef5e6 100644
--- a/src/benchmark/taler-exchange-benchmark.c
+++ b/src/benchmark/taler-exchange-benchmark.c
@@ -756,12 +756,12 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
 
   /* Wait for our master to die or to tell us to die */
   if (MODE_EXCHANGE == mode)
-    getchar ();
+    (void) getchar ();
 
   if ( (GNUNET_YES == linger) && ( (mode == MODE_BOTH || mode == MODE_CLIENT ) 
) )
   {
     printf("press ENTER to stop\n");
-    getchar ();
+    (void) getchar ();
   }
 
   if (MODE_CLIENT == mode)
diff --git a/src/lib/exchange_api_refresh.c b/src/lib/exchange_api_refresh.c
index ec9c1d99..e2a3a245 100644
--- a/src/lib/exchange_api_refresh.c
+++ b/src/lib/exchange_api_refresh.c
@@ -246,7 +246,7 @@ free_melt_data (struct MeltData *md)
   }
 
   for (unsigned int i=0;i<TALER_CNC_KAPPA;i++)
-    GNUNET_free (md->fresh_coins[i]);
+    GNUNET_free_non_null (md->fresh_coins[i]);
   /* Finally, clean up a bit...
      (NOTE: compilers might optimize this away, so this is
      not providing any strong assurances that the key material
@@ -705,6 +705,7 @@ TALER_EXCHANGE_refresh_prepare (const struct 
TALER_CoinSpendPrivateKeyP *melt_pr
   GNUNET_CRYPTO_eddsa_key_get_public (&melt_priv->eddsa_priv,
                                       &coin_pub.eddsa_pub);
   /* build up melt data structure */
+  memset (&md, 0, sizeof (md));
   md.num_fresh_coins = fresh_pks_len;
   md.melted_coin.coin_priv = *melt_priv;
   md.melted_coin.melt_amount_with_fee = *melt_amount;
@@ -713,8 +714,8 @@ TALER_EXCHANGE_refresh_prepare (const struct 
TALER_CoinSpendPrivateKeyP *melt_pr
   md.melted_coin.expire_deposit
     = melt_pk->expire_deposit;
   GNUNET_assert (GNUNET_OK ==
-                TALER_amount_get_zero (melt_amount->currency,
-                                       &total));
+                 TALER_amount_get_zero (melt_amount->currency,
+                                        &total));
   md.melted_coin.pub_key.rsa_public_key
     = GNUNET_CRYPTO_rsa_public_key_dup (melt_pk->key.rsa_public_key);
   md.melted_coin.sig.rsa_signature
@@ -726,13 +727,13 @@ TALER_EXCHANGE_refresh_prepare (const struct 
TALER_CoinSpendPrivateKeyP *melt_pr
     md.fresh_pks[i].rsa_public_key
       = GNUNET_CRYPTO_rsa_public_key_dup (fresh_pks[i].key.rsa_public_key);
     if ( (GNUNET_OK !=
-         TALER_amount_add (&total,
-                           &total,
-                           &fresh_pks[i].value)) ||
-        (GNUNET_OK !=
-         TALER_amount_add (&total,
-                           &total,
-                           &fresh_pks[i].fee_withdraw)) )
+          TALER_amount_add (&total,
+                            &total,
+                            &fresh_pks[i].value)) ||
+         (GNUNET_OK !=
+          TALER_amount_add (&total,
+                            &total,
+                            &fresh_pks[i].fee_withdraw)) )
     {
       GNUNET_break (0);
       free_melt_data (&md);
@@ -742,7 +743,7 @@ TALER_EXCHANGE_refresh_prepare (const struct 
TALER_CoinSpendPrivateKeyP *melt_pr
   /* verify that melt_amount is above total cost */
   if (1 ==
       TALER_amount_cmp (&total,
-                       melt_amount) )
+                        melt_amount) )
   {
     /* Eh, this operation is more expensive than the
        @a melt_amount. This is not OK. */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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