diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-12-06 12:37:51 +0100 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-12-06 12:37:51 +0100 |
commit | 381c5efb612e5393bb5a4e85420de8096b95a6e5 (patch) | |
tree | 2b4842273f15b6f6afb03581010257920a2a2726 /src/exchangedb | |
parent | 3e106030f1d9462dcf93f539acdfa5860833b152 (diff) |
[policy extensions] mark out work for #7999+#8001
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/pg_add_policy_fulfillment_proof.c | 10 |
1 files changed, 7 insertions, 3 deletions
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; } |