We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0275cf commit f8420a9Copy full SHA for f8420a9
1 file changed
src/features/sign_message_eip712/ui_logic.c
@@ -477,6 +477,10 @@ static bool ui_712_format_int(const uint8_t *data,
477
if (!first) {
478
return false;
479
}
480
+ if (length < 1) {
481
+ apdu_response_code = SWO_INCORRECT_DATA;
482
+ return false;
483
+ }
484
if (length > field_ptr->type_size) {
485
apdu_response_code = SWO_INCORRECT_DATA;
486
@@ -506,6 +510,10 @@ static bool ui_712_format_int(const uint8_t *data,
506
510
snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "%d", value16);
507
511
break;
508
512
case 8:
513
+ if (length != sizeof(int8_t)) {
514
515
516
509
517
value8 = (int8_t) data[0];
518
snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "%d", value8);
519
0 commit comments