mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-21 23:18:13 +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);
|
uint32_t addrlen = strlen(address);
|
||||||
if (qrcode) {
|
if (qrcode) {
|
||||||
char address_upcase[addrlen + 1];
|
char address_upcase[addrlen + 1];
|
||||||
|
memset(address_upcase, 0, sizeof(address_upcase));
|
||||||
if (ignorecase) {
|
if (ignorecase) {
|
||||||
for (uint32_t i = 0; i < addrlen + 1; i++) {
|
for (uint32_t i = 0; i < addrlen + 1; i++) {
|
||||||
address_upcase[i] = address[i] >= 'a' && address[i] <= 'z'
|
address_upcase[i] = address[i] >= 'a' && address[i] <= 'z'
|
||||||
|
@ -210,6 +210,7 @@ bool nem_askTransfer(const NEMTransactionCommon *common,
|
|||||||
bool unknownMosaic = false;
|
bool unknownMosaic = false;
|
||||||
|
|
||||||
const NEMMosaicDefinition *definitions[transfer->mosaics_count];
|
const NEMMosaicDefinition *definitions[transfer->mosaics_count];
|
||||||
|
memset(definitions, 0, sizeof(definitions));
|
||||||
|
|
||||||
for (size_t i = 0; i < transfer->mosaics_count; i++) {
|
for (size_t i = 0; i < transfer->mosaics_count; i++) {
|
||||||
const NEMMosaic *mosaic = &transfer->mosaics[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
|
// version + key bytes + checksum
|
||||||
uint8_t keylen = 1 + 32 + 2;
|
uint8_t keylen = 1 + 32 + 2;
|
||||||
uint8_t bytes_full[keylen];
|
uint8_t bytes_full[keylen];
|
||||||
|
memset(bytes_full, 0, sizeof(bytes_full));
|
||||||
|
|
||||||
bytes_full[0] = 6 << 3; // 'G'
|
bytes_full[0] = 6 << 3; // 'G'
|
||||||
|
|
||||||
memcpy(bytes_full + 1, bytes, 32);
|
memcpy(bytes_full + 1, bytes, 32);
|
||||||
|
Loading…
Reference in New Issue
Block a user