gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -fix null deref


From: gnunet
Subject: [taler-exchange] branch master updated: -fix null deref
Date: Tue, 19 Oct 2021 21:06:38 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 7ed66e1e -fix null deref
7ed66e1e is described below

commit 7ed66e1e2cb6be47505ee97a82392b1a21155d0a
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Oct 19 21:06:36 2021 +0200

    -fix null deref
---
 src/lib/exchange_api_handle.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 5ce5285d..215f122b 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -694,9 +694,8 @@ decode_keys_json (const json_t *resp_obj,
     GNUNET_JSON_spec_string ("currency",
                              &currency),
     GNUNET_JSON_spec_mark_optional (
-      TALER_JSON_spec_amount ("wallet_balance_limit_without_kyc",
-                              currency,
-                              &key_data->wallet_balance_limit_without_kyc)),
+      TALER_JSON_spec_amount_any ("wallet_balance_limit_without_kyc",
+                                  
&key_data->wallet_balance_limit_without_kyc)),
     GNUNET_JSON_spec_end ()
   };
 
@@ -763,6 +762,17 @@ decode_keys_json (const json_t *resp_obj,
                              (check_sig) ? mspec : &mspec[2],
                              NULL, NULL));
   key_data->currency = GNUNET_strdup (currency);
+
+  if (GNUNET_OK ==
+      TALER_amount_is_valid (&key_data->wallet_balance_limit_without_kyc))
+  {
+    if (0 != strcasecmp (currency,
+                         key_data->wallet_balance_limit_without_kyc.currency))
+    {
+      GNUNET_break_op (0);
+      return GNUNET_SYSERR;
+    }
+  }
   /* parse the master public key and issue date of the response */
   if (check_sig)
     hash_context = GNUNET_CRYPTO_hash_context_start ();

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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