Merge pull request #514 from LedgerHQ/fix/apa/token_ticker_length_check

Fix comparison for token ticker length being off by one
This commit is contained in:
apaillier-ledger
2023-12-18 17:45:37 +01:00
committed by GitHub

View File

@@ -127,7 +127,7 @@ void handleProvideErc20TokenInformation(uint8_t p1,
}
tickerLength = workBuffer[offset++];
dataLength--;
if ((tickerLength + 1) >= sizeof(token->ticker)) {
if ((tickerLength + 1) > sizeof(token->ticker)) {
THROW(0x6A80);
}
if (dataLength < tickerLength + 20 + 4 + 4) {