Release Zcash batch review widgets before signing
What changed, and why it matters
This commit fixes a potential memory/resource issue in the Zcash batch signing flow on the Keystone 3 hardware wallet. Before opening the signature view, the code now explicitly frees (destroys) the on-screen review widgets. Without this cleanup, the device could run low on memory or leave stale UI objects around while trying to display the signing screen, which might cause a crash or unexpected behavior during a transaction.
Treat as a low-to-moderate reliability/security hardening fix. Verify that all other coin-specific batch signing flows perform equivalent cleanup before transitioning to the signature view, and regression-test the Zcash batch signing UI to confirm no use-after-free or null-dereference issues are introduced by the new deletions.
Security signals we found
Resource cleanup before sensitive signing operation
UI object destruction to prevent memory pressure during cryptographic signing flow
Potential UI state inconsistency mitigated by explicit widget release
Evidence from the diff
In GuiZcashBatchWidgetsVerifyPasswordSuccess(), after password verification succeeds and before GuiFrameOpenViewWithParam(&g_transactionSignatureView, ...) is called, the patch adds GUI_DEL_OBJ() calls for g_txContainer, g_bottomBtnContainer, and g_signSlider. These are LVGL/UI container objects used during the transaction review phase. The change ensures the previous view’s widgets are destroyed and their memory/resources released prior to allocating the signature view, preventing resource leaks or double-creation of UI objects during the Zcash batch signing workflow.
Changed components
src/ui/gui_widgets/multi/cypherpunk/gui_zcash_batch_widgets.cZcash batch transaction signing UI flowLVGL widget lifecycle managementInspect captured patch +4 / −0
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 ca2a707..7c9f348 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
@@ -191,6 +191,10 @@ void GuiZcashBatchWidgetsVerifyPasswordSuccess(void)
return;
}
uint8_t viewType = ZcashBatchTx;
+ // Free the review widgets before allocating the signature view.
+ GUI_DEL_OBJ(g_txContainer)
+ GUI_DEL_OBJ(g_bottomBtnContainer)
+ GUI_DEL_OBJ(g_signSlider)
GuiFrameOpenViewWithParam(&g_transactionSignatureView, &viewType, sizeof(viewType));
}
Why this scored 35/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.