diff --git a/.github/workflows/swap.yml b/.github/workflows/swap.yml new file mode 100644 index 00000000..1a8068b1 --- /dev/null +++ b/.github/workflows/swap.yml @@ -0,0 +1,18 @@ +name: Swap functional tests + +on: + workflow_dispatch: + push: + branches: + - master + - main + - develop + pull_request: + +jobs: + job_functional_tests: + uses: LedgerHQ/app-exchange/.github/workflows/reusable_swap_functional_tests.yml@develop + with: + branch_for_polkadot: ${{ github.ref }} + repo_for_polkadot: ${{ github.repository }} + test_filter: '"DOT or dot or Polkadot or polkadot"' diff --git a/app/src/swap/handle_sign_transaction.c b/app/src/swap/handle_sign_transaction.c index ad50f351..29bf4b8c 100644 --- a/app/src/swap/handle_sign_transaction.c +++ b/app/src/swap/handle_sign_transaction.c @@ -93,7 +93,8 @@ parser_error_t check_swap_conditions(const parser_context_t *ctx) { ctx->tx_obj->callIndex.moduleIdx, ctx->tx_obj->callIndex.idx)); - if (strncmp(tmp_str, &valid_tx_method[0], strlen(valid_tx_method)) != 0) { + if (strnlen(tmp_str, sizeof(tmp_str)) != strlen(valid_tx_method) || + strncmp(tmp_str, &valid_tx_method[0], strlen(valid_tx_method)) != 0) { ZEMU_LOGF(200, "Wrong swap tx method (%s, should be : %s).\n", tmp_str, valid_tx_method); return parser_swap_tx_wrong_method; }