gui: render fills according to their fill type
What changed, and why it matters
This commit fixes a small user-interface bug in the Blockstream Jade hardware wallet's screen drawing code. Previously, all on-screen filled areas were rendered using either a normal or 'selected' color, ignoring a newer property called 'fill_type' that can request a highlight color or QR-code color. The change makes the code look at the fill_type and pick the correct color. There is no direct evidence in the commit or supplied references that this is a security fix, and the effect appears to be visual only.
Treat as a routine UI correctness fix. No immediate security action is required. If auditing, confirm that gui_get_highlight_color() and gui_get_qrcode_color() return safe, bounded color values, though the diff itself does not introduce new risk.
Security signals we found
No security-relevant keywords in commit title or message
Change is confined to GUI color selection
No buffer, pointer, or cryptographic operations modified
No input validation or trust-boundary changes
Evidence from the diff
In main/gui.c, render_fill() now branches on node->fill->fill_type (FILL_PLAIN, FILL_HIGHLIGHT, FILL_QR) and selects the appropriate color, including calls to gui_get_highlight_color() and gui_get_qrcode_color(), instead of always using node->fill->color or node->fill->selected_color. The patch adds an assertion for unknown fill types. The change is localized to GUI rendering and does not alter cryptographic, memory-management, or input-handling logic.
Changed components
main/gui.crender_fill() functionGUI fill renderingInspect captured patch +11 / −2
diff --git a/main/gui.c b/main/gui.c
index 888718d..45305d6 100644
--- a/main/gui.c
+++ b/main/gui.c
@@ -1872,9 +1872,18 @@ static void render_fill(gui_view_node_t* node, const dispWin_t cs, const uint8_t
JADE_ASSERT(node);
JADE_ASSERT(node->kind == FILL);
- color_t* color = node->is_selected ? &node->fill->selected_color : &node->fill->color;
+ color_t color;
+ if (node->fill->fill_type == FILL_PLAIN) {
+ color = node->is_selected ? node->fill->selected_color : node->fill->color;
+ } else if (node->fill->fill_type == FILL_HIGHLIGHT) {
+ color = gui_get_highlight_color();
+ } else if (node->fill->fill_type == FILL_QR) {
+ color = gui_get_qrcode_color();
+ } else {
+ JADE_ASSERT(false); // Unknown fill type
+ }
- display_fill_rect(cs.x1, cs.y1, cs.x2 - cs.x1, cs.y2 - cs.y1, *color);
+ display_fill_rect(cs.x1, cs.y1, cs.x2 - cs.x1, cs.y2 - cs.y1, color);
// Draw any children directly over the current node
gui_view_node_t* ptr = node->child;
Why this scored 18/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.