diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-06-03 11:20:47 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-06-03 11:20:47 +0200 |
commit | 01e8e930dc674684e545637d128b354d482efde6 (patch) | |
tree | a7b5c5672c4a0c484757ad4a2a9d8ce419448f71 /src | |
parent | 91ef87a804d34f535ef97b6caa7fbd6c327550e8 (diff) |
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 (limited to 'src')
-rw-r--r-- | src/bank-lib/bank_api_history.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; } |