gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 02/03: refuse endian conversion for invali


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 02/03: refuse endian conversion for invalid amounts
Date: Tue, 02 Jan 2018 00:07:48 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

commit 2d08d612f6802f9a369755267bf4a113cdc8d871
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jan 1 23:07:36 2018 +0100

    refuse endian conversion for invalid amounts
---
 src/util/amount.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/util/amount.c b/src/util/amount.c
index 7765c74..20d0642 100644
--- a/src/util/amount.c
+++ b/src/util/amount.c
@@ -207,6 +207,8 @@ void
 TALER_amount_hton (struct TALER_AmountNBO *res,
                    const struct TALER_Amount *d)
 {
+  GNUNET_assert (GNUNET_YES ==
+                TALER_amount_is_valid (d));
   res->value = GNUNET_htonll (d->value);
   res->fraction = htonl (d->fraction);
   memcpy (res->currency,
@@ -230,6 +232,8 @@ TALER_amount_ntoh (struct TALER_Amount *res,
   memcpy (res->currency,
           dn->currency,
           TALER_CURRENCY_LEN);
+  GNUNET_assert (GNUNET_YES ==
+                TALER_amount_is_valid (res));
 }
 
 

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



reply via email to

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