commit a11f6aa8f2fd716c4e6e3cd6b26d1f0623cc5eca
parent 6f69bc424ab330c03904e5317973a2e6748db8e0
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 20 Dec 2020 16:48:34 +0100
do not generate invalid /wire replies
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_wire2.c b/src/exchange/taler-exchange-httpd_wire2.c
@@ -213,6 +213,13 @@ build_wire_state (void)
json_decref (wire_accounts_array);
return NULL;
}
+ if (0 == json_array_size (wire_accounts_array))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "No bank accounts for the exchange configured. Administrator must `enable-account` with taler-exchange-offline!\n");
+ json_decref (wire_accounts_array);
+ return NULL;
+ }
wire_fee_object = json_object ();
GNUNET_assert (NULL != wire_fee_object);
{
@@ -243,6 +250,15 @@ build_wire_state (void)
json_decref (wire_accounts_array);
return NULL;
}
+ if (0 == json_array_size (a))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "No wire fees for `%s' configured. Administrator must set `wire-fee` with taler-exchange-offline!\n",
+ wire_method);
+ json_decref (wire_accounts_array);
+ json_decref (wire_fee_object);
+ return NULL;
+ }
GNUNET_assert (0 ==
json_object_set_new (wire_fee_object,
wire_method,