Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix string array length comparison causing index out of bound panic in index.go hasPrefix() #2

Conversation

EmmaLouise2018
Copy link

Reported by issue #1

@@ -75,7 +75,7 @@ func (o *IndexDef) changeColumn(originalName, newName string) {
}

func (o *IndexDef) hasPrefix(columns []string) bool {
if len(o.Columns) < len(columns) {
if len(o.Columns) > len(columns) {
Copy link
Owner

@bytewatch bytewatch Oct 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not modify this condition. If o.Columns is longger than columns, it may has a prefix of columns.
You should modify the for iteration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants