diff options
author | Christian Blättler <blatc2@bfh.ch> | 2024-04-26 09:29:29 +0200 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2024-04-26 09:29:29 +0200 |
commit | ae672cad398d8c9229677c372b333c99df03e6f5 (patch) | |
tree | 32057e1861753333a50e1f62b4ca2df7631a1bb0 /src | |
parent | 1f4f26adbbc442b0e7eae288a277d5c4fc44d924 (diff) |
fix choices length check
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c index 959c9e13..8eabeb00 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -2143,7 +2143,7 @@ phase_execute_pay_transaction (struct PayContext *pc) static void phase_validate_tokens (struct PayContext *pc) { - if (NULL == pc->choices || 0 <= pc->choices_len) + if (NULL == pc->choices || 0 >= pc->choices_len) { /* No tokens to validate */ pc->phase = PP_PAY_TRANSACTION; @@ -2168,7 +2168,7 @@ phase_validate_tokens (struct PayContext *pc) if (pc->choice_index >= pc->choices_len) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Order `%s' has choices array with %u elements but" + "Order `%s' has choices array with %u elements but " "request has 'choice_index' field with value %ld\n", pc->order_id, pc->choices_len, @@ -2718,6 +2718,8 @@ phase_parse_wallet_data (struct PayContext *pc) TALER_json_hash (pc->wallet_data, &pc->h_wallet_data); + + pc->phase = PP_CHECK_CONTRACT; } |