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)

This commit is contained in:
Christian Grothoff 2019-06-03 11:20:47 +02:00
parent 91ef87a804
commit 01e8e930dc
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -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;
}