fix: ignore disabled assets in manage count
What changed, and why it matters
This commit fixes a UI counting bug in the Keystone hardware wallet's home screen. Previously, disabled cryptocurrency assets were still being counted when calculating how many wallets were shown in the asset management view. The fix ensures disabled assets are excluded from the count and their checkbox state is cleared. There is no direct evidence this is a security vulnerability—it's primarily a user-interface correctness fix.
Treat as a routine UI bug fix. No immediate security response is indicated. If desired, verify that disabled assets are not selectable or exposed elsewhere in the wallet management flow, but the diff itself does not suggest a security defect.
Security signals we found
UI state consistency fix
No cryptographic, authentication, or memory-safety changes
No input validation, buffer handling, or privilege boundary changes
No vendor security disclosure or CVE references present
Evidence from the diff
The patch modifies UpdateManageWalletState() in two home widget implementations (cypherpunk and general/web3). The original code incremented total only when g_walletState[i].enable was true, but did not explicitly handle the disabled case. The new code explicitly checks !g_walletState[i].enable, clears LV_STATE_CHECKED on the checkbox if present, and skips to the next iteration. The total and selectCnt logic is otherwise preserved. This prevents disabled assets from contributing to the displayed wallet count and ensures their checkbox is unchecked.
Changed components
src/ui/gui_widgets/multi/cypherpunk/gui_cypherpunk_home_widgets.csrc/ui/gui_widgets/multi/web3/gui_general_home_widgets.cInspect captured patch +14 / −4
diff --git a/src/ui/gui_widgets/multi/cypherpunk/gui_cypherpunk_home_widgets.c b/src/ui/gui_widgets/multi/cypherpunk/gui_cypherpunk_home_widgets.c
index fab847c..32eee90 100644
--- a/src/ui/gui_widgets/multi/cypherpunk/gui_cypherpunk_home_widgets.c
+++ b/src/ui/gui_widgets/multi/cypherpunk/gui_cypherpunk_home_widgets.c
@@ -112,9 +112,14 @@ static void UpdateManageWalletState(bool needUpdate)
g_isManageOpen = false;
int total = 0;
for (int i = 0; i < HOME_WALLET_CARD_BUTT; i++) {
- if (g_walletState[i].enable) {
- total++;
+ if (!g_walletState[i].enable) {
+ if (g_walletState[i].checkBox != NULL) {
+ lv_obj_clear_state(g_walletState[i].checkBox, LV_STATE_CHECKED);
+ }
+ continue;
}
+
+ total++;
if (g_walletBakState[i].state == true) {
selectCnt++;
lv_obj_add_state(g_walletState[i].checkBox, LV_STATE_CHECKED);
diff --git a/src/ui/gui_widgets/multi/web3/gui_general_home_widgets.c b/src/ui/gui_widgets/multi/web3/gui_general_home_widgets.c
index 63e80bc..525ff0e 100644
--- a/src/ui/gui_widgets/multi/web3/gui_general_home_widgets.c
+++ b/src/ui/gui_widgets/multi/web3/gui_general_home_widgets.c
@@ -187,9 +187,14 @@ static void UpdateManageWalletState(bool needUpdate)
continue;
}
- if (g_walletState[i].enable) {
- total++;
+ if (!g_walletState[i].enable) {
+ if (g_walletState[i].checkBox != NULL) {
+ lv_obj_clear_state(g_walletState[i].checkBox, LV_STATE_CHECKED);
+ }
+ continue;
}
+
+ total++;
if (g_walletBakState[i].state == true) {
selectCnt++;
if (g_walletState[i].checkBox != NULL) {
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.