commit ae672cad398d8c9229677c372b333c99df03e6f5
parent 1f4f26adbbc442b0e7eae288a277d5c4fc44d924
Author: Christian Blättler <blatc2@bfh.ch>
Date: Fri, 26 Apr 2024 09:29:29 +0200
fix choices length check
Diffstat:
1 file 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
@@ -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;
}