Skip to content

Commit 009895d

Browse files
committed
fix(core): scope trezorui_api.confirm_with_info() layouts
Fixes #6780 (OOM on T3T1 during large input data confirmation). Explicitly drop internal Rust layout object, in order to avoid #5472 (comment)
1 parent 6d6f372 commit 009895d

5 files changed

Lines changed: 31 additions & 42 deletions

File tree

core/.changelog.d/6780.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix out-of-memory failure when confirming large input data.

core/src/trezor/ui/layouts/bolt/__init__.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -645,16 +645,13 @@ async def should_show_more(
645645
Raises ActionCancelled if the user cancels.
646646
"""
647647

648-
result = await interact(
649-
trezorui_api.confirm_with_info(
650-
title=title,
651-
items=items,
652-
verb=confirm or TR.buttons__confirm,
653-
verb_info=button_text,
654-
),
655-
br_name,
656-
br_code,
657-
)
648+
with trezorui_api.confirm_with_info(
649+
title=title,
650+
items=items,
651+
verb=confirm or TR.buttons__confirm,
652+
verb_info=button_text,
653+
) as layout_obj:
654+
result = await interact(layout_obj, br_name, br_code)
658655

659656
if result is CONFIRMED:
660657
return False

core/src/trezor/ui/layouts/caesar/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -724,17 +724,14 @@ async def should_show_more(
724724

725725
if button_text not in (DOWN_ARROW, ""):
726726
button_text = INFO_ICON
727-
result = await interact(
728-
trezorui_api.confirm_with_info(
729-
title=title,
730-
items=para,
731-
verb=confirm or TR.buttons__confirm,
732-
verb_cancel=verb_cancel,
733-
verb_info=button_text, # use info icon by default
734-
),
735-
br_name,
736-
br_code,
737-
)
727+
with trezorui_api.confirm_with_info(
728+
title=title,
729+
items=para,
730+
verb=confirm or TR.buttons__confirm,
731+
verb_cancel=verb_cancel,
732+
verb_info=button_text, # use info icon by default
733+
) as layout_obj:
734+
result = await interact(layout_obj, br_name, br_code)
738735

739736
if result is CONFIRMED:
740737
return False

core/src/trezor/ui/layouts/delizia/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -664,17 +664,14 @@ async def should_show_more(
664664
"""
665665
button_text = button_text or TR.buttons__show_all # def_arg
666666

667-
result = await interact(
668-
trezorui_api.confirm_with_info(
669-
title=title,
670-
subtitle=subtitle,
671-
items=para,
672-
verb=(TR.buttons__confirm if confirm is None else confirm),
673-
verb_info=button_text,
674-
),
675-
br_name,
676-
br_code,
677-
)
667+
with trezorui_api.confirm_with_info(
668+
title=title,
669+
subtitle=subtitle,
670+
items=para,
671+
verb=(TR.buttons__confirm if confirm is None else confirm),
672+
verb_info=button_text,
673+
) as layout_obj:
674+
result = await interact(layout_obj, br_name, br_code)
678675

679676
if result is CONFIRMED:
680677
return False

core/src/trezor/ui/layouts/eckhart/__init__.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -673,16 +673,13 @@ async def should_show_more(
673673
if confirm is None or not isinstance(confirm, str):
674674
confirm = TR.buttons__confirm
675675

676-
result = await interact(
677-
trezorui_api.confirm_with_info(
678-
title=title,
679-
items=para,
680-
verb=confirm,
681-
verb_info=button_text,
682-
),
683-
br_name,
684-
br_code,
685-
)
676+
with trezorui_api.confirm_with_info(
677+
title=title,
678+
items=para,
679+
verb=confirm,
680+
verb_info=button_text,
681+
) as layout_obj:
682+
result = await interact(layout_obj, br_name, br_code)
686683

687684
if result is CONFIRMED:
688685
return False

0 commit comments

Comments
 (0)