AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 42 Bitcoin

fix(core/ui): avoid signed overflow when calculating text width

Public commit record

What the developer wrote

Authored by Martin Milata

67/100 · Adequate
fix(core/ui): avoid signed overflow when calculating text width

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Names security-relevant behavior explicitly! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a bug in how the Trezor hardware wallet calculates the width of on-screen text. Previously, very long text could cause an internal counter to overflow from a large positive number to a negative number, which might make text appear incorrectly sized or positioned. The fix uses saturating arithmetic so the counter stops at the maximum safe value instead of wrapping around.

Recommended action

Treat as a low-severity hardening fix. Review whether any callers of text_width() or related layout functions could be fed attacker-controlled long strings and whether negative widths previously caused buffer misbehavior. Consider adding an input-length or width bound for untrusted text. No urgent response required absent evidence of exploitability.

Security signals we found

01

Signed integer overflow in UI text measurement

02

Use of saturating arithmetic as defensive fix

03

Potential UI/layout misbehavior from negative width values

Risk score

Why this scored 42/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 6/15
Affected reach 7/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.