Skip to content

Commit

Permalink
chore: check input lenght
Browse files Browse the repository at this point in the history
  • Loading branch information
vaigay committed Aug 28, 2024
1 parent b5ce8cc commit 3f252c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/decoder/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ func Decode(ABI *abi.ABI, input string) (*tradingTypes.ContractCall, error) {
if err != nil {
return nil, err
}

if len(input) < 10 {
return nil, fmt.Errorf("input data is too short")
}
bytes, err := hex.DecodeString(input[10:])
if err != nil {
return nil, err
Expand Down

0 comments on commit 3f252c3

Please sign in to comment.