fix(core): avoid constructing an empty Pager
What changed, and why it matters
This is a tiny one-line fix in the user-interface code of the Trezor hardware wallet. It changes a placeholder value from 0 to 1 so that a UI scrollbar helper object is never created with 'zero pages,' which would trigger an internal sanity check (a debug assertion) and crash the device in debug/test builds. In release builds the assertion is normally removed, so the practical security impact is low. There is no direct evidence this is exploitable by an attacker.
No urgent action required. Treat as a normal code-quality/debugging fix. If the project runs automated UI tests or debug builds on device, ensure this path is covered so the panic cannot resurface. No security advisory or CVE appears warranted based on the commit alone.
Security signals we found
panic/crash in debug builds due to debug_assert
defensive programming fix for internal invariant violation
UI component placeholder initialization bug
Evidence from the diff
In core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs, the ScrollBar::to_be_filled_later() constructor was changed from Self::new(0) to Self::new(1). The underlying Pager::new() panics when debug_asserts are enabled if constructed with zero pages. The fix prevents an empty Pager from being instantiated as a temporary placeholder before the real page count is supplied. This only affects debug builds and UI rendering paths; release firmware would not panic here.
Changed components
core/embed/rust/src/ui/layout_caesar/component/scrollbar.rsTrezor Core UI layout_caesar scrollbar/pager componentInspect captured patch +1 / −1
diff --git a/core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs b/core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs
index dd1ee52b..45416d7f 100644
--- a/core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs
+++ b/core/embed/rust/src/ui/layout_caesar/component/scrollbar.rs
@@ -46,7 +46,7 @@ impl ScrollBar {
/// Page count will be given later as it is not available yet.
pub fn to_be_filled_later() -> Self {
- Self::new(0)
+ Self::new(1)
}
pub const fn dots_width(dots_shown: u16) -> i16 {
Why this scored 21/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.