Skip to content

Commit 0bb4d5e

Browse files
committed
chore(app): Review changes
1 parent 3274194 commit 0bb4d5e

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

apps/inheritance_app/inheritance_auth_wallet.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ static bool auth_wallet_get_entropy() {
128128

129129
if (status != CARD_OPERATION_SUCCESS ||
130130
msgs[0].encrypted_data_size > ENTROPY_SIZE_LIMIT) {
131+
inheritance_send_error(ERROR_COMMON_ERROR_CORRUPT_DATA_TAG,
132+
ERROR_DATA_FLOW_INVALID_QUERY);
133+
delay_scr_init(ui_text_inheritance_wallet_auth_fail, DELAY_TIME);
131134
return false;
132135
}
133136
set_app_flow_status(INHERITANCE_AUTH_WALLET_STATUS_CARD_TAPPED);
@@ -196,7 +199,13 @@ static bool send_result() {
196199
*****************************************************************************/
197200

198201
void inheritance_auth_wallet(inheritance_query_t *query) {
199-
auth = (auth_wallet_config_t *)cy_malloc(sizeof(auth_wallet_config_t));
202+
auth = (auth_wallet_config_t *)malloc(sizeof(auth_wallet_config_t));
203+
if (auth == NULL) {
204+
inheritance_send_error(ERROR_COMMON_ERROR_UNKNOWN_ERROR_TAG,
205+
ERROR_DATA_FLOW_INVALID_DATA);
206+
delay_scr_init(ui_text_inheritance_wallet_auth_fail, DELAY_TIME);
207+
return;
208+
}
200209
memzero(auth, sizeof(auth_wallet_config_t));
201210

202211
memcpy(
@@ -212,4 +221,10 @@ void inheritance_auth_wallet(inheritance_query_t *query) {
212221
auth_wallet_get_pairs() && auth_wallet_get_signature() && send_result()) {
213222
delay_scr_init(ui_text_inheritance_wallet_auth_success, DELAY_TIME);
214223
}
224+
225+
memzero(auth, sizeof(auth_wallet_config_t));
226+
if (NULL != auth) {
227+
free(auth);
228+
auth = NULL;
229+
}
215230
}

apps/inheritance_app/inheritance_main.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include "app_registry.h"
2222
#include "events.h"
23-
#include "inheritance/core.pb.h"
2423
#include "inheritance_context.h"
2524
/*****************************************************************************
2625
* MACROS AND DEFINES

apps/inheritance_app/inheritance_priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
/*****************************************************************************
1414
* INCLUDES
1515
*****************************************************************************/
16-
#include <inheritance/core.pb.h>
1716
#include <stdint.h>
1817

18+
#include "inheritance/core.pb.h"
1919
#include "inheritance_context.h"
2020
#include "nem.h"
2121

0 commit comments

Comments
 (0)