Skip to content

Commit 9c5c9bc

Browse files
Merge pull request #616 from LedgerHQ/fix/apa/consecutive_eip712
Fix uninitialized UI buffer for EIP-712
2 parents 44b5a23 + 617291d commit 9c5c9bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src_features/signMessageEIP712/ui_logic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ e_eip712_nfs ui_712_next_field(void) {
177177
handle_eip712_return_code(true);
178178
state = EIP712_FIELD_INCOMING;
179179
// So that later when we append to them, we start from an empty string
180-
explicit_bzero(strings.tmp.tmp, sizeof(strings.tmp.tmp));
181-
explicit_bzero(strings.tmp.tmp2, sizeof(strings.tmp.tmp2));
180+
explicit_bzero(&strings, sizeof(strings));
182181
}
183182
}
184183
return state;
@@ -622,6 +621,7 @@ bool ui_712_init(void) {
622621
if ((ui_ctx = MEM_ALLOC_AND_ALIGN_TYPE(*ui_ctx))) {
623622
explicit_bzero(ui_ctx, sizeof(*ui_ctx));
624623
ui_ctx->filtering_mode = EIP712_FILTERING_BASIC;
624+
explicit_bzero(&strings, sizeof(strings));
625625
} else {
626626
apdu_response_code = APDU_RESPONSE_INSUFFICIENT_MEMORY;
627627
}

0 commit comments

Comments
 (0)