From 9ed8971f2af210c54380a0433cca383b19e56f85 Mon Sep 17 00:00:00 2001 From: Xavier Chapron Date: Thu, 31 Aug 2023 14:24:29 +0200 Subject: [PATCH] lib_standard_app: Remove write on BSS variable when app is called in swap mode Writting these varaible is not needed and might collide with app-exchange BSS. Therefore they should be init only if: - the app is in standalone mode - the app is in lib mode, for a SIGN_TRANSACTION command and the params from exchange have already been retrieved. --- lib_standard_app/main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib_standard_app/main.c b/lib_standard_app/main.c index cd4bf6f81..9c80220a2 100644 --- a/lib_standard_app/main.c +++ b/lib_standard_app/main.c @@ -94,9 +94,6 @@ static void standalone_app_main(void) { #ifdef HAVE_SWAP static void library_app_main(libargs_t *args) { - G_called_from_swap = true; - G_swap_response_ready = false; - BEGIN_TRY { TRY { PRINTF("Inside library\n"); @@ -107,7 +104,7 @@ static void library_app_main(libargs_t *args) { // BSS data. bool success = swap_copy_transaction_parameters(args->create_transaction); if (success) { - // BSS was wiped, so init these global again + // BSS was wiped, we can now init these globals G_called_from_swap = true; G_swap_response_ready = false;