exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 320ab53cf14adf87456c56f3a15fd17b4ff9d6e6
parent fbc7b88249282cb9cb61587a17b200981d68bbcd
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 15 Dec 2025 21:14:54 +0100

fix #10666 crash

Diffstat:
Msrc/exchange/taler-exchange-httpd_aml-attributes-get.c | 24+++++++++++++++++++-----
Msrc/mhd/mhd_typst.c | 10+++++-----
2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_aml-attributes-get.c b/src/exchange/taler-exchange-httpd_aml-attributes-get.c @@ -182,8 +182,12 @@ free_rc (struct TEH_RequestContext *rc) break; case RCF_PDF: for (size_t i = 0; i<rctx->details.pdf.off; i++) + { json_decref (rctx->details.pdf.jdata[i]); + rctx->details.pdf.jdata[i] = NULL; + } json_decref (rctx->details.pdf.global_attrs); + rctx->details.pdf.global_attrs = NULL; break; } GNUNET_free (rctx); @@ -750,11 +754,21 @@ TEH_handler_aml_attributes_get ( GNUNET_assert (0 != rctx->details.pdf.off); for (unsigned int i = 0; i<rctx->details.pdf.off; i++) { - GNUNET_assert (0 == - json_object_update_missing ( - rctx->details.pdf.jdata[i], - rctx->details.pdf.global_attrs) - ); + /* The jdata[i] could be a *string* in case of attachments, + ignore those here! */ + if (NULL == rctx->details.pdf.docs[i].form_name) + { + GNUNET_assert (json_is_string (rctx->details.pdf.jdata[i])); + } + else + { + GNUNET_assert (json_is_object (rctx->details.pdf.jdata[i])); + GNUNET_assert (0 == + json_object_update_missing ( + rctx->details.pdf.jdata[i], + rctx->details.pdf.global_attrs) + ); + } } GNUNET_CONTAINER_DLL_insert (rctx_head, rctx_tail, diff --git a/src/mhd/mhd_typst.c b/src/mhd/mhd_typst.c @@ -190,11 +190,11 @@ inline_pdf_stage (struct TypstStage *stage, GNUNET_break (0); return false; } - if (GNUNET_OK != - GNUNET_STRINGS_string_to_data_alloc (str, - strlen (str), - &b, - &n)) + b = NULL; + n = GNUNET_STRINGS_base64_decode (str, + strlen (str), + &b); + if (NULL == b) { GNUNET_break (0); return false;