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

leveled: fix a bug may cause panic #300

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WangXiangUSTC
Copy link

fix issue: #224

Copy link

@tgulacsi tgulacsi left a comment

Choose a reason for hiding this comment

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

Calling with slice.Start > slice.Limit is a programmer's error, and should panic.
Please add an explicit

if slice.Start != nil && slice.Limit != nil && *slice.Start > *slice.Limit { 
    panic("slice.Start cannot be greater than slice.Limit") 
}

right after the slice != nil check, to keep the panic when the caller provided bogus Range.

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