Skip to content

Commit

Permalink
Merge pull request #3 from blooo-io/switch-to-strnlen
Browse files Browse the repository at this point in the history
fix: switch from strlen to strnlen
  • Loading branch information
n4l5u0r authored Oct 29, 2021
2 parents 6e5cfaa + 8b2cff2 commit 10b976a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/handle_query_contract_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ static void prepend_ticker(char *dest, size_t destsize, const char *ticker) {
if (dest == NULL || ticker == NULL) {
THROW(0x6503);
}
uint8_t ticker_len = strlen(ticker);
uint8_t dest_len = strlen(dest);
size_t ticker_len = strnlen(ticker, MAX_TICKER_LEN);
size_t dest_len = strnlen(dest, destsize - ticker_len);

if (dest_len + ticker_len >= destsize) {
THROW(0x6503);
Expand Down
Binary file modified tests/elfs/paraswap_nanos.elf
Binary file not shown.
Binary file modified tests/elfs/paraswap_nanox.elf
Binary file not shown.

0 comments on commit 10b976a

Please sign in to comment.