sendMessage will wrongfully fail in a scenario where a user sends max data length
Summary
The sendMessage function currently verifies if the data length is greater than or equal to the specified max length. However, it should permit the operation even when the data length is equal to the MAX_DATA_LENGTH.
Vulnerability Detail
As the current logic checks length >= MAX_DATA_LENGTH, a user attempting to send a message with the maximum allowable data will encounter failure. Instead, the check should allow the operation to pass when the length equals MAX_DATA_LENGTH.
Impact
User will not be able to make use of the projects sendmessage function in certain scenario's
dermaroller5
medium
sendMessage will wrongfully fail in a scenario where a user sends max data length
Summary
The
sendMessage
function currently verifies if the data length is greater than or equal to the specified max length. However, it should permit the operation even when the data length is equal to theMAX_DATA_LENGTH
.Vulnerability Detail
As the current logic checks
length >= MAX_DATA_LENGTH
, a user attempting to send a message with the maximum allowable data will encounter failure. Instead, the check should allow the operation to pass when the length equalsMAX_DATA_LENGTH
.Impact
User will not be able to make use of the projects
sendmessage
function in certain scenario'sCode Snippet
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L300-L303
Tool used
Manual Review
Recommendation