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

fix(core): correct `debug_assert` in `get_button_border()`

Public commit record

What the developer wrote

Authored by Roman Zeyde

77/100 · Adequate
fix(core): correct `debug_assert` in `get_button_border()`

There are `MAX_KEYS` buttons + the `cancel` button.

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes an off-by-one error in a debug-only assertion inside a Trezor hardware wallet screen. The assertion checks whether a button index is valid, but it previously rejected the last valid button (the 'cancel' button). The fix changes '<' to '<=' so the assertion no longer falsely triggers. This is a minor correctness fix in debug builds and does not change release behavior or user-facing security.

Recommended action

No security action required. Treat as a normal code-quality/debugging fix. If auditing, confirm no other '< MAX_KEYS' checks elsewhere incorrectly exclude the cancel button index.

Security signals we found

01

Off-by-one in bounds check

02

Debug-only assertion correction

03

No release-runtime effect

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 8/10
Evidence quality 4/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.