Skip to content

Commit

Permalink
lib_standard_app: Remove write on BSS variable when app is called in …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Xavier Chapron authored and xchapron-ledger committed Sep 1, 2023
1 parent 8b2b9cb commit 9ed8971
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib_standard_app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;

Expand Down

0 comments on commit 9ed8971

Please sign in to comment.