Skip to content

Commit

Permalink
fix: swap method len should match
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala committed Feb 21, 2024
1 parent 828eb04 commit 38082fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/swap/handle_sign_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 38082fa

Please sign in to comment.