aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mint/taler-mint-httpd_admin.c13
-rw-r--r--src/util/json.c3
2 files changed, 13 insertions, 3 deletions
diff --git a/src/mint/taler-mint-httpd_admin.c b/src/mint/taler-mint-httpd_admin.c
index ce63917ef..6928dac8b 100644
--- a/src/mint/taler-mint-httpd_admin.c
+++ b/src/mint/taler-mint-httpd_admin.c
@@ -136,15 +136,26 @@ TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
res = TMH_PARSE_json_data (connection,
root,
spec);
- json_decref (root);
if (GNUNET_OK != res)
+ {
+ json_decref (root);
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
+ }
+ if (GNUNET_YES !=
+ TALER_json_validate_wireformat (TMH_expected_wire_format,
+ wire))
+ {
+ TMH_PARSE_release_data (spec);
+ return TMH_RESPONSE_reply_arg_unknown (connection,
+ "wire");
+ }
res = TMH_DB_execute_admin_add_incoming (connection,
&reserve_pub,
&amount,
at,
wire);
TMH_PARSE_release_data (spec);
+ json_decref (root);
return res;
}
diff --git a/src/util/json.c b/src/util/json.c
index 004f7734c..8faee6035 100644
--- a/src/util/json.c
+++ b/src/util/json.c
@@ -299,9 +299,8 @@ TALER_json_to_amount (json_t *json,
{
char *json_enc;
- GNUNET_break_op (0);
if (NULL == (json_enc = json_dumps (json,
- JSON_COMPACT | JSON_SORT_KEYS | JSON_ENCODE_ANY)))
+ JSON_COMPACT | JSON_ENCODE_ANY)))
{
GNUNET_break (0);
return GNUNET_SYSERR;