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 unbalanced parenthesis panic when compiling filter #120

Merged
merged 1 commit into from
Jun 26, 2017

Conversation

vetinari
Copy link
Contributor

fixes #117

@@ -82,7 +82,10 @@ func CompileFilter(filter string) (*ber.Packet, error) {
if err != nil {
return nil, err
}
if pos != len(filter) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see how this improves the error message, but I'm surprised this fixes a panic...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the panic happens at accessing filter[pos:] for pos > len(filter).

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, didn't scroll to the right :)

@liggitt liggitt merged commit b314d42 into go-ldap:master Jun 26, 2017
@vetinari vetinari deleted the fix-filter-compile branch June 27, 2017 06:00
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.

CompileFilter crashes while logging error if the filter is missing brackets
2 participants