@@ -128,6 +128,9 @@ static bool auth_wallet_get_entropy() {
128
128
129
129
if (status != CARD_OPERATION_SUCCESS ||
130
130
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 );
131
134
return false;
132
135
}
133
136
set_app_flow_status (INHERITANCE_AUTH_WALLET_STATUS_CARD_TAPPED );
@@ -196,7 +199,13 @@ static bool send_result() {
196
199
*****************************************************************************/
197
200
198
201
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
+ }
200
209
memzero (auth , sizeof (auth_wallet_config_t ));
201
210
202
211
memcpy (
@@ -212,4 +221,10 @@ void inheritance_auth_wallet(inheritance_query_t *query) {
212
221
auth_wallet_get_pairs () && auth_wallet_get_signature () && send_result ()) {
213
222
delay_scr_init (ui_text_inheritance_wallet_auth_success , DELAY_TIME );
214
223
}
224
+
225
+ memzero (auth , sizeof (auth_wallet_config_t ));
226
+ if (NULL != auth ) {
227
+ free (auth );
228
+ auth = NULL ;
229
+ }
215
230
}
0 commit comments