From 381c5efb612e5393bb5a4e85420de8096b95a6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Wed, 6 Dec 2023 12:37:51 +0100 Subject: [policy extensions] mark out work for #7999+#8001 --- src/exchangedb/pg_add_policy_fulfillment_proof.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/exchangedb/pg_add_policy_fulfillment_proof.c') diff --git a/src/exchangedb/pg_add_policy_fulfillment_proof.c b/src/exchangedb/pg_add_policy_fulfillment_proof.c index 0fd6b1c92..93d070712 100644 --- a/src/exchangedb/pg_add_policy_fulfillment_proof.c +++ b/src/exchangedb/pg_add_policy_fulfillment_proof.c @@ -55,6 +55,7 @@ TEH_PG_add_policy_fulfillment_proof ( enum GNUNET_DB_QueryStatus qs; struct PostgresClosure *pg = cls; size_t count = fulfillment->details_count; + /* FIXME: this seems to be prone to VLA attacks */ struct GNUNET_HashCode hcs[count]; /* Create the sorted policy_hash_codes */ @@ -84,8 +85,7 @@ TEH_PG_add_policy_fulfillment_proof ( GNUNET_PQ_query_param_timestamp (&fulfillment->timestamp), TALER_PQ_query_param_json (fulfillment->proof), GNUNET_PQ_query_param_auto_from_type (&fulfillment->h_proof), - GNUNET_PQ_query_param_fixed_size (hcs, - count * sizeof(struct GNUNET_HashCode)), + TALER_PQ_query_param_array_hash_code (count, hcs, pg->conn), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -132,7 +132,6 @@ TEH_PG_add_policy_fulfillment_proof ( GNUNET_PQ_query_param_end }; - // FIXME-Oec: review if this is the intended logic here! PREPARE (pg, "update_policy_details", "UPDATE policy_details SET" @@ -151,5 +150,10 @@ TEH_PG_add_policy_fulfillment_proof ( } } + /* + * FIXME[oec]-#7999: When all policies of a deposit are fulfilled, + * unblock it and trigger a wire-transfer. + */ + return qs; } -- cgit v1.2.3