summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-09-11 23:56:28 +0200
committerChristian Grothoff <christian@grothoff.org>2023-09-11 23:56:28 +0200
commit6759228b6010aaa70ddf153d15ace604328d4bf6 (patch)
tree599ad27bc2d08583c8d1cb0f818dc7ec9ca38b22
parentd0b27e71a71ab44058fb148754363c6fd2286dcf (diff)
downloadmerchant-6759228b6010aaa70ddf153d15ace604328d4bf6.tar.gz
merchant-6759228b6010aaa70ddf153d15ace604328d4bf6.tar.bz2
merchant-6759228b6010aaa70ddf153d15ace604328d4bf6.zip
fix failure to initialize credit_facade details if DB had NULL values
-rw-r--r--src/backend/taler-merchant-httpd_private-post-account.c18
-rw-r--r--src/backenddb/pg_select_account_by_uri.c2
2 files changed, 14 insertions, 6 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-account.c b/src/backend/taler-merchant-httpd_private-post-account.c
index 6ad3902d..793e6c79 100644
--- a/src/backend/taler-merchant-httpd_private-post-account.c
+++ b/src/backend/taler-merchant-httpd_private-post-account.c
@@ -153,8 +153,10 @@ TMH_private_post_account (const struct TMH_RequestHandler *rh,
ad.payto_uri) ) &&
( (adx.credit_facade_credentials ==
ad.credit_facade_credentials) ||
- (1 == json_equal (adx.credit_facade_credentials,
- ad.credit_facade_credentials)) ) &&
+ ( (NULL != adx.credit_facade_credentials) &&
+ (NULL != ad.credit_facade_credentials) &&
+ (1 == json_equal (adx.credit_facade_credentials,
+ ad.credit_facade_credentials)) ) ) &&
( (adx.credit_facade_url == ad.credit_facade_url) ||
( (NULL != adx.credit_facade_url) &&
(NULL != ad.credit_facade_url) &&
@@ -165,10 +167,14 @@ TMH_private_post_account (const struct TMH_RequestHandler *rh,
GNUNET_free (adx.payto_uri);
return TALER_MHD_REPLY_JSON_PACK (connection,
MHD_HTTP_OK,
- GNUNET_JSON_pack_data_auto ("salt",
- &adx.salt),
- GNUNET_JSON_pack_data_auto ("h_wire",
- &adx.h_wire));
+ GNUNET_JSON_pack_data_auto (
+ "salt",
+ &adx.
+ salt),
+ GNUNET_JSON_pack_data_auto (
+ "h_wire",
+ &adx.
+ h_wire));
}
break;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
diff --git a/src/backenddb/pg_select_account_by_uri.c b/src/backenddb/pg_select_account_by_uri.c
index a0fbffb3..1faeeb27 100644
--- a/src/backenddb/pg_select_account_by_uri.c
+++ b/src/backenddb/pg_select_account_by_uri.c
@@ -56,6 +56,8 @@ TMH_PG_select_account_by_uri (void *cls,
GNUNET_PQ_result_spec_end
};
+ ad->credit_facade_url = NULL;
+ ad->credit_facade_credentials = NULL;
ad->payto_uri = GNUNET_strdup (payto_uri);
check_connection (pg);
PREPARE (pg,