Skip to content

Commit bae8f45

Browse files
Donjon-CerberusCerberus Merlin
andauthored
fix: Out-of-bounds read in amount-join token address comparison in update_amount_join (#984)
Co-authored-by: Cerberus Merlin <merlin@cerberus.security>
1 parent fcd1af8 commit bae8f45

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/features/sign_message_eip712/ui_logic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ static bool update_amount_join(const uint8_t *data, uint8_t length) {
638638
}
639639
switch (ui_ctx->amount.state) {
640640
case AMOUNT_JOIN_STATE_TOKEN:
641+
if (length != ADDRESS_LENGTH) {
642+
apdu_response_code = SWO_INCORRECT_DATA;
643+
return false;
644+
}
641645
if (token != NULL) {
642646
if (memcmp(data, token->address, ADDRESS_LENGTH) != 0) {
643647
return false;

0 commit comments

Comments
 (0)