commit 6759228b6010aaa70ddf153d15ace604328d4bf6
parent d0b27e71a71ab44058fb148754363c6fd2286dcf
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 11 Sep 2023 23:56:28 +0200
fix failure to initialize credit_facade details if DB had NULL values
Diffstat:
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
@@ -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
@@ -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,