diff --git a/app/src/swap/handle_sign_transaction.c b/app/src/swap/handle_sign_transaction.c index ad50f351..c887235a 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(valid_tx_method, sizeof(tmp_str)) != strlen(tmp_str) || + 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; }