fix(zcash): guard batch refresh display state
What changed, and why it matters
This is a small, defensive fix in the Zcash batch transaction screen of a Keystone hardware wallet. It adds a check that a UI display object actually exists before continuing to refresh the screen. Without the guard, the refresh function could potentially use a null (uninitialized) object, which on embedded devices can lead to a crash or undefined behavior. There is no direct evidence in the commit that this is exploitable as a security vulnerability, but null-pointer issues in firmware UI paths can sometimes be triggered by malformed transaction data and affect device availability.
Treat as a minor hardening fix. Include in normal firmware release notes as a stability improvement. No urgent security response is warranted unless additional analysis shows the null state can be reached from untrusted input (e.g., a malformed Zcash transaction) and leads to a reproducible crash or information leak.
Security signals we found
Null-pointer guard added to UI refresh function
Potential denial-of-service/crash hardening in firmware UI path
No explicit security claim or CVE referenced in commit
Evidence from the diff
In GuiZcashBatchWidgetsRefresh(), the existing guard only checked g_parseResult and g_parseResult->error_code. The patch adds an additional condition: g_displayZcashBatch == NULL. This prevents the function from proceeding when the Zcash batch display state object has not been initialized. The change is one line and is purely a hardening guard; it does not alter transaction parsing or signing logic. The crash path, if any, would be a null-pointer dereference in the UI refresh routine, not a cryptographic or memory-corruption flaw.
Changed components
src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.cZcash batch transaction UI refresh routineInspect captured patch +1 / −1
diff --git a/src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.c b/src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.c
index f1b5e08..24b1e1c 100644
--- a/src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.c
+++ b/src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.c
@@ -372,7 +372,7 @@ static void GuiRenderCurrentTransaction(bool showSignSlider)
void GuiZcashBatchWidgetsRefresh(void)
{
- if (g_parseResult == NULL || g_parseResult->error_code != 0) {
+ if (g_parseResult == NULL || g_parseResult->error_code != 0 || g_displayZcashBatch == NULL) {
return;
}
Why this scored 33/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.