From 01e8e930dc674684e545637d128b354d482efde6 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 3 Jun 2019 11:20:47 +0200 Subject: 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) --- src/bank-lib/bank_api_history.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/bank-lib/bank_api_history.c b/src/bank-lib/bank_api_history.c index 2520fa16f..7cf169663 100644 --- 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; } -- cgit v1.2.3