From 611587832f5817229f78ec82391f93e4292de4c7 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 18 Dec 2023 17:26:53 +0100 Subject: [PATCH] Fix comparison for token ticker length being off by one --- .../provideErc20TokenInformation/cmd_provideTokenInfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src_features/provideErc20TokenInformation/cmd_provideTokenInfo.c b/src_features/provideErc20TokenInformation/cmd_provideTokenInfo.c index 496c54a..ff55f7d 100644 --- a/src_features/provideErc20TokenInformation/cmd_provideTokenInfo.c +++ b/src_features/provideErc20TokenInformation/cmd_provideTokenInfo.c @@ -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) {