aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-08-21 10:57:09 +0200
committerFlorian Dold <florian@dold.me>2024-08-21 10:57:09 +0200
commitbe6fa8255ea124df6df3d378a8f3fdaaf6fe2e84 (patch)
tree1c1c06ba3b546e29f81f482850ffdbc3908d4d17 /src
parentd8129d34448d571975c26c96b4a640d58cfb1226 (diff)
aml: handle NULL values in DB for justification and properties
Fixes #9102
Diffstat (limited to 'src')
-rw-r--r--src/exchangedb/pg_lookup_aml_history.c8
-rw-r--r--src/exchangedb/pg_lookup_records_by_table.c8
-rw-r--r--src/exchangedb/pg_select_aml_decisions.c10
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
index 0eab9a2a2..4a38f8bd7 100644
--- 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
index cbd972424..52f64cf91 100644
--- 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
index c817e443f..4c488b352 100644
--- 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",