-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
In index.go there is the function hasPrefix()
func (o *IndexDef) hasPrefix(columns []string) bool {
if len(o.Columns) < len(columns) {
return false
}
for i := range o.Columns {
if o.Columns[i] != columns[i] {
return false
}
}
return true
}
This causes an index out of bounds exception if the length of o.Columns is longer than that of columns since we are iterating through o.Columns in the for loop.
This check should be if len(o.Columns) > len(columns) to make sure we are not iterating through the longer array.
After making this change, all the tests continue to pass as expected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels