exchange

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

commit 01e8e930dc674684e545637d128b354d482efde6
parent 91ef87a804d34f535ef97b6caa7fbd6c327550e8
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  3 Jun 2019 11:20:47 +0200

add guard logic to check sizeof(value) is sufficient (should be -- size is 20, needed are 5, but still the new code is strictly safer even if slower)

Diffstat:
Msrc/bank-lib/bank_api_history.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/bank-lib/bank_api_history.c b/src/bank-lib/bank_api_history.c @@ -366,11 +366,13 @@ conv_cancel (enum TALER_BANK_Direction direction) if (TALER_BANK_DIRECTION_CANCEL == (TALER_BANK_DIRECTION_CANCEL & direction)) - strcpy (&ret.value[0], - "show"); + GNUNET_snprintf (ret.value, + sizeof (ret.value), + "show"); else - strcpy (&ret.value[0], - "omit"); + GNUNET_snprintf (ret.value, + sizeof (ret.value), + "omit"); return ret; }