We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fea90a9 commit 3e0deddCopy full SHA for 3e0dedd
accounts/abi/type.go
@@ -103,7 +103,11 @@ func NewType(t string) (typ Type, err error) {
103
return typ, err
104
}
105
// parse the type and size of the abi-type.
106
- parsedType := typeRegex.FindAllStringSubmatch(t, -1)[0]
+ matches := typeRegex.FindAllStringSubmatch(t, -1)
107
+ if len(matches) == 0 {
108
+ return Type{}, fmt.Errorf("invalid type '%v'", t)
109
+ }
110
+ parsedType := matches[0]
111
// varSize is the size of the variable
112
var varSize int
113
if len(parsedType[3]) > 0 {
0 commit comments