1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 11:28:14 +00:00

firmware: fix unaligned access

This commit is contained in:
Pavol Rusnak 2019-04-01 15:31:45 +02:00
parent 3d37dd850d
commit ac5e3268f7
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -374,7 +374,8 @@ void layoutConfirmOmni(const uint8_t *data, uint32_t size) {
suffix = "USDT"; suffix = "USDT";
break; break;
} }
const uint64_t amount = *(const uint64_t *)(data + 12); uint64_t amount;
memcpy(&amount, data + 12, sizeof(uint64_t));
bn_format_uint64(amount, NULL, suffix, BITCOIN_DIVISIBILITY, 0, false, bn_format_uint64(amount, NULL, suffix, BITCOIN_DIVISIBILITY, 0, false,
str_out, sizeof(str_out)); str_out, sizeof(str_out));
} else { } else {