summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-24 18:59:42 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-24 18:59:42 +0100
commitee77c6ff211e961fdedb7a6a44ee0fd0a9a5a042 (patch)
tree1c2b14bcca526ec79f4dd3b9da0f5ed90a847e75 /src/backend
parentd004d4a89e0f6799d08d6a6b33c558b5a9eb480e (diff)
downloadmerchant-ee77c6ff211e961fdedb7a6a44ee0fd0a9a5a042.tar.gz
merchant-ee77c6ff211e961fdedb7a6a44ee0fd0a9a5a042.tar.bz2
merchant-ee77c6ff211e961fdedb7a6a44ee0fd0a9a5a042.zip
fix #8209
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-pay.c9
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c53
2 files changed, 44 insertions, 18 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 4ba5411e..53b5b22d 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- (C) 2014-2023 Taler Systems SA
+ (C) 2014-2024 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -652,7 +652,7 @@ resume_pay_with_response (struct PayContext *pc,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Resuming /pay handling. HTTP status for our reply is %u.\n",
response_code);
-#if PARTIAL_FIX_8209
+#if 1
for (unsigned int i = 0; i<pc->num_exchanges; i++)
{
struct ExchangeGroup *eg = pc->egs[i];
@@ -1372,7 +1372,6 @@ process_pay_with_keys (
return;
}
-
/* Now that we have the details about the denomination, we can verify age
* restriction requirements, if applicable. Note that denominations with an
* age_mask equal to zero always pass the age verification. */
@@ -1478,6 +1477,7 @@ AGE_FAIL:
.refund_deadline = pc->refund_deadline
};
enum TALER_ErrorCode ec;
+ unsigned int off = 0;
for (unsigned int i = 0; i<pc->coins_cnt; i++)
{
@@ -1488,7 +1488,8 @@ AGE_FAIL:
if (0 != strcmp (dc->exchange_url,
eg->exchange_url))
continue;
- cdds[i] = dc->cdd;
+ GNUNET_assert (off < group_size);
+ cdds[off++] = dc->cdd;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Initiating batch deposit with %u coins\n",
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
index 74ba7fb7..5986a521 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -602,6 +602,31 @@ clean_order (void *cls)
json_decref (oc->set_exchanges.exchanges);
oc->set_exchanges.exchanges = NULL;
}
+ if (NULL != oc->parse_order.merchant)
+ {
+ json_decref (oc->parse_order.merchant);
+ oc->parse_order.merchant = NULL;
+ }
+ if (NULL != oc->parse_order.fulfillment_message_i18n)
+ {
+ json_decref (oc->parse_order.fulfillment_message_i18n);
+ oc->parse_order.fulfillment_message_i18n = NULL;
+ }
+ if (NULL != oc->parse_order.summary_i18n)
+ {
+ json_decref (oc->parse_order.summary_i18n);
+ oc->parse_order.summary_i18n = NULL;
+ }
+ if (NULL != oc->parse_order.delivery_location)
+ {
+ json_decref (oc->parse_order.delivery_location);
+ oc->parse_order.delivery_location = NULL;
+ }
+ if (NULL != oc->merge_inventory.products)
+ {
+ json_decref (oc->merge_inventory.products);
+ oc->merge_inventory.products = NULL;
+ }
GNUNET_array_grow (oc->parse_request.inventory_products,
oc->parse_request.inventory_products_length,
0);
@@ -1113,8 +1138,8 @@ get_acceptable (void *cls,
TMH_EXCHANGES_get_master_pub (exchange)));
GNUNET_assert (NULL != j_exchange);
GNUNET_assert (0 ==
- json_array_append (oc->set_exchanges.exchanges,
- j_exchange));
+ json_array_append_new (oc->set_exchanges.exchanges,
+ j_exchange));
}
@@ -1239,8 +1264,8 @@ serialize_order (struct OrderContext *oc)
GNUNET_JSON_pack_string ("summary",
oc->parse_order.summary),
GNUNET_JSON_pack_allow_null (
- GNUNET_JSON_pack_object_steal ("summary_i18n",
- oc->parse_order.summary_i18n)),
+ GNUNET_JSON_pack_object_incref ("summary_i18n",
+ oc->parse_order.summary_i18n)),
GNUNET_JSON_pack_allow_null (
GNUNET_JSON_pack_string ("public_reorder_url",
oc->parse_order.public_reorder_url)),
@@ -1248,13 +1273,13 @@ serialize_order (struct OrderContext *oc)
GNUNET_JSON_pack_string ("fulfillment_message",
oc->parse_order.fulfillment_message)),
GNUNET_JSON_pack_allow_null (
- GNUNET_JSON_pack_object_steal ("fulfillment_message_i18n",
- oc->parse_order.fulfillment_message_i18n)),
+ GNUNET_JSON_pack_object_incref ("fulfillment_message_i18n",
+ oc->parse_order.fulfillment_message_i18n)),
GNUNET_JSON_pack_allow_null (
GNUNET_JSON_pack_string ("fulfillment_url",
oc->parse_order.fulfillment_url)),
- GNUNET_JSON_pack_array_steal ("products",
- oc->merge_inventory.products),
+ GNUNET_JSON_pack_array_incref ("products",
+ oc->merge_inventory.products),
GNUNET_JSON_pack_data_auto ("h_wire",
&oc->add_payment_details.wm->h_wire),
GNUNET_JSON_pack_string ("wire_method",
@@ -1271,16 +1296,16 @@ serialize_order (struct OrderContext *oc)
GNUNET_JSON_pack_timestamp ("delivery_date",
oc->parse_order.delivery_date)),
GNUNET_JSON_pack_allow_null (
- GNUNET_JSON_pack_object_steal ("delivery_location",
- oc->parse_order.delivery_location)),
+ GNUNET_JSON_pack_object_incref ("delivery_location",
+ oc->parse_order.delivery_location)),
GNUNET_JSON_pack_string ("merchant_base_url",
oc->parse_order.merchant_base_url),
- GNUNET_JSON_pack_object_steal ("merchant",
- oc->parse_order.merchant),
+ GNUNET_JSON_pack_object_incref ("merchant",
+ oc->parse_order.merchant),
GNUNET_JSON_pack_data_auto ("merchant_pub",
&oc->hc->instance->merchant_pub),
- GNUNET_JSON_pack_array_steal ("exchanges",
- oc->set_exchanges.exchanges),
+ GNUNET_JSON_pack_array_incref ("exchanges",
+ oc->set_exchanges.exchanges),
TALER_JSON_pack_amount ("max_fee",
&oc->set_max_fee.max_fee),
TALER_JSON_pack_amount ("amount",