exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit be6fa8255ea124df6df3d378a8f3fdaaf6fe2e84
parent d8129d34448d571975c26c96b4a640d58cfb1226
Author: Florian Dold <florian@dold.me>
Date:   Wed, 21 Aug 2024 10:57:09 +0200

aml: handle NULL values in DB for justification and properties

Fixes #9102

Diffstat:
Msrc/exchangedb/pg_lookup_aml_history.c | 8+++++---
Msrc/exchangedb/pg_lookup_records_by_table.c | 8+++++---
Msrc/exchangedb/pg_select_aml_decisions.c | 10++++++----
3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/exchangedb/pg_lookup_aml_history.c b/src/exchangedb/pg_lookup_aml_history.c @@ -76,7 +76,7 @@ handle_aml_entry (void *cls, char *justification; struct TALER_AmlOfficerPublicKeyP decider_pub; json_t *jproperties; - json_t *jnew_rules; + json_t *jnew_rules = NULL; bool to_investigate; bool is_active; struct GNUNET_PQ_ResultSpec rs[] = { @@ -86,8 +86,10 @@ handle_aml_entry (void *cls, &justification), GNUNET_PQ_result_spec_auto_from_type ("decider_pub", &decider_pub), - TALER_PQ_result_spec_json ("jproperties", - &jproperties), + GNUNET_PQ_result_spec_allow_null ( + TALER_PQ_result_spec_json ("jproperties", + &jproperties), + NULL), TALER_PQ_result_spec_json ("jnew_rules", &jnew_rules), GNUNET_PQ_result_spec_bool ("to_investigate", diff --git a/src/exchangedb/pg_lookup_records_by_table.c b/src/exchangedb/pg_lookup_records_by_table.c @@ -2783,9 +2783,11 @@ lrbt_cb_table_legitimization_outcomes (void *cls, GNUNET_PQ_result_spec_timestamp ( "expiration_time", &td.details.legitimization_outcomes.expiration_time), - TALER_PQ_result_spec_json ( - "jproperties", - &td.details.legitimization_outcomes.properties), + GNUNET_PQ_result_spec_allow_null ( + TALER_PQ_result_spec_json ( + "jproperties", + &td.details.legitimization_outcomes.properties), + NULL), GNUNET_PQ_result_spec_bool ( "to_investigate_id", &td.details.legitimization_outcomes.to_investigate), diff --git a/src/exchangedb/pg_select_aml_decisions.c b/src/exchangedb/pg_select_aml_decisions.c @@ -73,10 +73,10 @@ handle_aml_result (void *cls, { struct TALER_PaytoHashP h_payto; uint64_t rowid; - char *justification; + char *justification = NULL; struct GNUNET_TIME_Timestamp decision_time; struct GNUNET_TIME_Absolute expiration_time; - json_t *jproperties; + json_t *jproperties = NULL; bool to_investigate; bool is_active; json_t *account_rules; @@ -93,8 +93,10 @@ handle_aml_result (void *cls, &decision_time), GNUNET_PQ_result_spec_absolute_time ("expiration_time", &expiration_time), - TALER_PQ_result_spec_json ("jproperties", - &jproperties), + GNUNET_PQ_result_spec_allow_null ( + TALER_PQ_result_spec_json ("jproperties", + &jproperties), + NULL), TALER_PQ_result_spec_json ("jnew_rules", &account_rules), GNUNET_PQ_result_spec_bool ("to_investigate",