exchange

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

commit a2d3841fff6ba615386fb232de5c2f4c6852f18e
parent 0bcc4289a9abc8abb3294edcc511ae0c694ee017
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu, 13 Aug 2026 20:18:23 +0200

do not return uninitialized vlaues on failure

Diffstat:
Msrc/util/crypto_helper_esign.c | 18+++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/util/crypto_helper_esign.c b/src/util/crypto_helper_esign.c @@ -355,6 +355,14 @@ TALER_CRYPTO_helper_esign_sign_ ( { uint32_t purpose_size = ntohl (purpose->size); + /* clear the outputs, so that we never return + uninitialized values on failures */ + memset (exchange_pub, + 0, + sizeof (*exchange_pub)); + memset (exchange_sig, + 0, + sizeof (*exchange_sig)); if (GNUNET_OK != try_connect (esh)) { @@ -425,10 +433,14 @@ TALER_CRYPTO_helper_esign_sign_ ( } if (0 == ret) { + /* helper closed the connection */ GNUNET_break (0 == off); - if (finished) - return TALER_EC_NONE; - return TALER_EC_EXCHANGE_SIGNKEY_HELPER_BUG; + do_disconnect (esh); + if (! finished) + return TALER_EC_EXCHANGE_SIGNKEY_HELPER_BUG; + if (TALER_EC_NONE == ec) + break; + return ec; } off += ret; more: