1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-27 01:48:17 +00:00

nem: check length in layoutNEMTransferPayload

This commit is contained in:
Pavol Rusnak 2018-05-25 16:34:06 +02:00
parent 1f470cf1f1
commit 0ae5e91fcb
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -759,7 +759,7 @@ void layoutNEMTransferUnknownMosaic(const char *namespace, const char *mosaic, u
}
void layoutNEMTransferPayload(const uint8_t *payload, size_t length, bool encrypted) {
if (payload[0] == 0xFE) {
if (length >= 1 && payload[0] == 0xFE) {
char encoded[(length - 1) * 2 + 1];
data2hex(&payload[1], length - 1, encoded);