-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix 'panic: runtime error: slice bounds out of range' #801
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
Conversation
The Edit: Please also use our pull-request template. |
Made the suggested change and updated the initial description to use your template. Did not mark each section with a check as I didn't touch those areas -- not clear whether they should be checked despite this. |
Do you mind moving the
above the pluginName code and remove the |
Can you also tell use how you ran into that bug, i.e. what database server and version you are using? |
// return | ||
//} | ||
//return ErrMalformPkt | ||
if end := bytes.IndexByte(data[pos:], 0x00); end != -1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant moving the comment here (add an extra blank line above). Besides that, the changes LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah... ok, will do
Thanks! |
I am getting the following error with this new code:
With the old code, I get the slice bounds out of range error. |
Description
The code added in commit f557730 introduced a bug that prevents access to some databases by failing to check to see if the data it is looking for was actually present. This corrects that.
Discovered using MemSQL 5.5.8.
The data in the packet that was received in the
readInitPacket()
function was:Checklist