From 262940332979dfc3f0703ce12638abab8c63605c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 22 Jul 2021 13:09:25 +0200 Subject: add more location checks --- ...aler-merchant-httpd_private-patch-instances-ID.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/backend/taler-merchant-httpd_private-patch-instances-ID.c') diff --git a/src/backend/taler-merchant-httpd_private-patch-instances-ID.c b/src/backend/taler-merchant-httpd_private-patch-instances-ID.c index 8b0917e7..bafccb59 100644 --- a/src/backend/taler-merchant-httpd_private-patch-instances-ID.c +++ b/src/backend/taler-merchant-httpd_private-patch-instances-ID.c @@ -114,6 +114,27 @@ patch_instances_ID (struct TMH_MerchantInstance *mi, TALER_EC_GENERIC_CURRENCY_MISMATCH, NULL); } + + if (! TMH_location_object_valid (is.address)) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "address"); + } + + if (! TMH_location_object_valid (is.jurisdiction)) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "jurisdiction"); + } + if (! TMH_payto_uri_array_valid (payto_uris)) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, -- cgit v1.2.3