commit 9287b8c860dd7e96708630aa5a2164afbb57b575
parent 89d0c20d050b0e41c3a925544f64abe31e924890
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 19 May 2026 21:03:48 +0200
-fix minor bugs
Diffstat:
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c b/src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c
@@ -25,6 +25,8 @@
#include "exchange-database/lookup_completed_legitimization.h"
#include "exchange-database/lookup_pending_legitimization.h"
+#define DEBUG 0
+
#define MAX_RETRIES 3
/**
@@ -528,9 +530,13 @@ TEH_handler_kyc_upload (
TALER_EC_GENERIC_PARAMETER_MALFORMED,
"FORM_ID");
}
+#if DEBUG
json_dumpf (root,
stderr,
JSON_INDENT (2));
+ fprintf (stderr,
+ "\n");
+#endif
}
if (NULL != uc->response)
{
diff --git a/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-attest.c b/src/exchange/taler-exchange-httpd_post-reserves-RESERVE_PUB-attest.c
@@ -199,8 +199,12 @@ kyc_process_cb (void *cls,
continue; /* duplicate */
json_array_foreach (rsc->details, idx, str)
{
- if (0 == strcmp (json_string_value (str),
- name))
+ const char *sval = json_string_value (str);
+
+ GNUNET_break (NULL != sval);
+ if ( (NULL != sval) &&
+ (0 == strcmp (json_string_value (str),
+ name)) )
{
requested = true;
break;
@@ -304,6 +308,8 @@ TEH_handler_reserves_attest (
{
enum GNUNET_GenericReturnValue res;
+ size_t idx;
+ json_t *e;
res = TALER_MHD_parse_json_data (rc->connection,
root,
@@ -318,6 +324,16 @@ TEH_handler_reserves_attest (
GNUNET_break_op (0);
return MHD_YES; /* failure */
}
+ json_array_foreach (rsc.details, idx, e)
+ if (! json_is_string (e))
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (
+ rc->connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_PARAMETER_MALFORMED,
+ "details");
+ }
}
now = GNUNET_TIME_timestamp_get ();
if (! GNUNET_TIME_absolute_approx_eq (now.abs_time,