diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-01-06 15:52:12 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-01-06 15:52:12 +0100 |
commit | 73a9fe56eb2fd9c7126eeffa396998815112e2e5 (patch) | |
tree | 01adc81864e1e12e75ce2b8ff198865af32b8e19 /src/exchange/taler-exchange-httpd_wire.c | |
parent | 1f9121126395ac56bbccad4c1de60ca5c1c47983 (diff) |
add checks to ensure payto:// URI is well-formed to taler-exchange-offline, and taler-exchange-httpd where applicable (fixes #6675)
Diffstat (limited to 'src/exchange/taler-exchange-httpd_wire.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_wire.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_wire.c b/src/exchange/taler-exchange-httpd_wire.c index 885d10d7..1942c7e4 100644 --- a/src/exchange/taler-exchange-httpd_wire.c +++ b/src/exchange/taler-exchange-httpd_wire.c @@ -232,6 +232,15 @@ build_wire_state (void) "payto_uri")); GNUNET_assert (NULL != payto_uri); wire_method = TALER_payto_get_method (payto_uri); + if (NULL == wire_method) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "payto:// URI `%s' stored in our database is malformed\n", + payto_uri); + json_decref (wire_accounts_array); + json_decref (wire_fee_object); + return NULL; + } if (NULL == json_object_get (wire_fee_object, wire_method)) { @@ -248,6 +257,7 @@ build_wire_state (void) json_decref (a); json_decref (wire_fee_object); json_decref (wire_accounts_array); + GNUNET_free (wire_method); return NULL; } if (0 == json_array_size (a)) @@ -257,6 +267,7 @@ build_wire_state (void) wire_method); json_decref (wire_accounts_array); json_decref (wire_fee_object); + GNUNET_free (wire_method); return NULL; } GNUNET_assert (0 == |