aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-07-18 18:59:11 +0200
committerChristian Grothoff <christian@grothoff.org>2021-07-18 18:59:11 +0200
commit5cec88e87e987d80905e1a9b810c0e77c051f7bf (patch)
treee3f1254c92be280d33f0144c2e42b6cdcdeda071 /src
parent67559ad6261e6d272df6665c8c0e124fd795a6eb (diff)
-fix segv
Diffstat (limited to 'src')
-rw-r--r--src/bank-lib/fakebank.c3
-rw-r--r--src/json/json_helper.c19
2 files changed, 17 insertions, 5 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index 673135d81..06bfae0ad 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 c3788f863..866c094d0 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;
}