Skip to content

Commit ad40ecc

Browse files
committed
zero address node
1 parent 2c72c2d commit ad40ecc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

views/flipbip_scene_1.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,16 @@ typedef struct {
8080
CONFIDENTIAL const char* xpub_extended;
8181
} FlipBipScene1Model;
8282

83+
// Node for the receive address
8384
static CONFIDENTIAL HDNode* s_addr_node = NULL;
84-
85+
// Generic display text
8586
static CONFIDENTIAL char* s_disp_text1 = NULL;
8687
static CONFIDENTIAL char* s_disp_text2 = NULL;
8788
static CONFIDENTIAL char* s_disp_text3 = NULL;
8889
static CONFIDENTIAL char* s_disp_text4 = NULL;
8990
static CONFIDENTIAL char* s_disp_text5 = NULL;
9091
static CONFIDENTIAL char* s_disp_text6 = NULL;
91-
92+
// Derivation path text
9293
static const char* s_derivation_text = TEXT_DEFAULT_DERIV;
9394
//static bool s_busy = false;
9495

@@ -196,11 +197,11 @@ static void
196197
flipbip_scene_1_draw_address(const HDNode* node, uint32_t addr_type, uint32_t addr_index) {
197198
//s_busy = true;
198199

199-
// buffer for address serialization
200+
// Buffer for address serialization
200201
const size_t buflen = 40;
201202
char buf[40 + 1] = {0};
202203

203-
// use static node for address generation
204+
// Use static node for address generation
204205
memcpy(s_addr_node, node, sizeof(HDNode));
205206

206207
hdnode_private_ckd(s_addr_node, addr_index);
@@ -233,6 +234,9 @@ static void
233234
flipbip_scene_1_draw_generic(address, 12);
234235
}
235236

237+
// Clear the address node
238+
memzero(s_addr_node, sizeof(HDNode));
239+
236240
//s_busy = false;
237241
}
238242

0 commit comments

Comments
 (0)