diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-06-05 09:18:35 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-06-05 09:18:35 +0200 |
commit | 98b51edf496cdc14974690c9809f665f14858977 (patch) | |
tree | eb48f666852c8df8b940d001bc0b0ef644df4a55 /src/exchange/taler-exchange-httpd_batch-withdraw.c | |
parent | fb5bc18c588832747dfe299f9df1beb6645cf686 (diff) | |
parent | 8cc1edfe0aa77d3091f19aa87d06bb45c74b0128 (diff) |
Merge branch 'master' into age-withdraw
Diffstat (limited to 'src/exchange/taler-exchange-httpd_batch-withdraw.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_batch-withdraw.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-httpd_batch-withdraw.c b/src/exchange/taler-exchange-httpd_batch-withdraw.c index d97a5f0a..04a9d720 100644 --- a/src/exchange/taler-exchange-httpd_batch-withdraw.c +++ b/src/exchange/taler-exchange-httpd_batch-withdraw.c @@ -848,10 +848,10 @@ TEH_handler_batch_withdraw (struct TEH_RequestContext *rc, .reserve_pub = reserve_pub, .rc = rc }; - json_t *planchets; + const json_t *planchets; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_json ("planchets", - &planchets), + GNUNET_JSON_spec_array_const ("planchets", + &planchets), GNUNET_JSON_spec_end () }; @@ -867,20 +867,17 @@ TEH_handler_batch_withdraw (struct TEH_RequestContext *rc, if (GNUNET_OK != res) return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES; } - if ( (! json_is_array (planchets)) || - (0 == json_array_size (planchets)) ) + wc.planchets_length = json_array_size (planchets); + if (0 == wc.planchets_length) { - GNUNET_JSON_parse_free (spec); GNUNET_break_op (0); return TALER_MHD_reply_with_error (rc->connection, MHD_HTTP_BAD_REQUEST, TALER_EC_GENERIC_PARAMETER_MALFORMED, "planchets"); } - wc.planchets_length = json_array_size (planchets); if (wc.planchets_length > TALER_MAX_FRESH_COINS) { - GNUNET_JSON_parse_free (spec); GNUNET_break_op (0); return TALER_MHD_reply_with_error (rc->connection, MHD_HTTP_BAD_REQUEST, @@ -906,7 +903,6 @@ TEH_handler_batch_withdraw (struct TEH_RequestContext *rc, TALER_blinded_planchet_free (&pc->blinded_planchet); TALER_blinded_denom_sig_free (&pc->collectable.sig); } - GNUNET_JSON_parse_free (spec); return ret; } } |