From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 18 Nov 2026 16:01:54 +0100 Subject: [PATCH] exchange: handle POST /kyc-upload without an ID The route accepts zero URL segments, so the handler must not assume args[0] is set. Issue: https://bugs.taler.net/n/12188 Assisted by LLM --- src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c b/src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c index fdb77af0e..3bb2dd5e4 100644 --- a/src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c +++ b/src/exchange/taler-exchange-httpd_post-kyc-upload-ID.c @@ -514,6 +514,16 @@ TEH_handler_kyc_upload ( uc->result = root; rc->rh_ctx = uc; rc->rh_cleaner = &upload_cleaner; + if (NULL == id) + { + /* the route also matches /kyc-upload without an ID */ + GNUNET_break_op (0); + return TALER_MHD_reply_with_error ( + rc->connection, + MHD_HTTP_NOT_FOUND, + TALER_EC_GENERIC_ENDPOINT_UNKNOWN, + rc->url); + } slash = strchr (id, '-'); if (NULL == slash) { -- 2.47.3