gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -fix segv


From: gnunet
Subject: [taler-exchange] branch master updated: -fix segv
Date: Sun, 18 Jul 2021 18:59:18 +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 5cec88e8 -fix segv
5cec88e8 is described below

commit 5cec88e87e987d80905e1a9b810c0e77c051f7bf
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jul 18 18:59:11 2021 +0200

    -fix segv
---
 src/bank-lib/fakebank.c |  3 ++-
 src/json/json_helper.c  | 19 +++++++++++++++----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index 673135d8..06bfae0a 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -866,7 +866,8 @@ TALER_FAKEBANK_check_empty (struct TALER_FAKEBANK_Handle *h)
   {
     struct Transaction *t = h->transactions[i];
 
-    if (t->unchecked)
+    if ( (NULL != t) &&
+         (t->unchecked) )
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   "Expected empty transaction set, but I have:\n");
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index c3788f86..866c094d 100644
--- a/src/json/json_helper.c
+++ b/src/json/json_helper.c
@@ -115,6 +115,7 @@ parse_amount_nbo (void *cls,
                   struct GNUNET_JSON_Specification *spec)
 {
   struct TALER_AmountNBO *r_amount = spec->ptr;
+  const char *sv;
 
   (void) cls;
   if (! json_is_string (root))
@@ -122,10 +123,14 @@ parse_amount_nbo (void *cls,
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
+  sv = json_string_value (root);
   if (GNUNET_OK !=
-      TALER_string_to_amount_nbo (json_string_value (root),
+      TALER_string_to_amount_nbo (sv,
                                   r_amount))
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "`%s' is not a valid amount\n",
+                sv);
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
@@ -172,7 +177,8 @@ parse_abs_time (void *cls,
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
-  json_t_ms = json_object_get (root, "t_ms");
+  json_t_ms = json_object_get (root,
+                               "t_ms");
   if (json_is_integer (json_t_ms))
   {
     tval = json_integer_value (json_t_ms);
@@ -196,16 +202,18 @@ parse_abs_time (void *cls,
   if (json_is_string (json_t_ms))
   {
     const char *val;
+
     val = json_string_value (json_t_ms);
     if ((0 == strcasecmp (val, "never")))
     {
       *abs = GNUNET_TIME_UNIT_FOREVER_ABS;
       return GNUNET_OK;
     }
-    GNUNET_break_op (0);
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "`%s' is not a valid absolute time\n",
+                json_string_value (json_t_ms));
     return GNUNET_SYSERR;
   }
-  GNUNET_break_op (0);
   return GNUNET_SYSERR;
 }
 
@@ -252,7 +260,10 @@ parse_abs_time_nbo (void *cls,
       parse_abs_time (NULL,
                       root,
                       &ispec))
+  {
+    GNUNET_break_op (0);
     return GNUNET_SYSERR;
+  }
   *abs = GNUNET_TIME_absolute_hton (a);
   return GNUNET_OK;
 }

-- 
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]