mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 23:08:14 +00:00
legacy: explicitly initialize variable length arrays
This commit is contained in:
parent
08265cdd08
commit
fa9d349bc9
@ -574,6 +574,7 @@ void layoutAddress(const char *address, const char *desc, bool qrcode,
|
||||
uint32_t addrlen = strlen(address);
|
||||
if (qrcode) {
|
||||
char address_upcase[addrlen + 1];
|
||||
memset(address_upcase, 0, sizeof(address_upcase));
|
||||
if (ignorecase) {
|
||||
for (uint32_t i = 0; i < addrlen + 1; i++) {
|
||||
address_upcase[i] = address[i] >= 'a' && address[i] <= 'z'
|
||||
|
@ -210,6 +210,7 @@ bool nem_askTransfer(const NEMTransactionCommon *common,
|
||||
bool unknownMosaic = false;
|
||||
|
||||
const NEMMosaicDefinition *definitions[transfer->mosaics_count];
|
||||
memset(definitions, 0, sizeof(definitions));
|
||||
|
||||
for (size_t i = 0; i < transfer->mosaics_count; i++) {
|
||||
const NEMMosaic *mosaic = &transfer->mosaics[i];
|
||||
|
@ -1339,6 +1339,8 @@ size_t stellar_publicAddressAsStr(const uint8_t *bytes, char *out,
|
||||
// version + key bytes + checksum
|
||||
uint8_t keylen = 1 + 32 + 2;
|
||||
uint8_t bytes_full[keylen];
|
||||
memset(bytes_full, 0, sizeof(bytes_full));
|
||||
|
||||
bytes_full[0] = 6 << 3; // 'G'
|
||||
|
||||
memcpy(bytes_full + 1, bytes, 32);
|
||||
|
Loading…
Reference in New Issue
Block a user