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 panic in case of one line realm configuration #448

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

obatysh
Copy link

@obatysh obatysh commented Sep 9, 2021

We had a panic problem parsing a config with one line realm configuration, like:
[realms]
ATHENA.MIT.EDU = { kdc = kerberos.mit.edu }

panic: runtime error: slice bounds out of range [1:0]
in config.parseRealms

The following change fixes the panic problem.

@jcmturner
Copy link
Owner

Thanks for the PR. Some observations I have...

  • Is the one line configuration actually invalid or should krb5conf handle parsing it? I'm not sure but we should check that out.
  • Which ever way we handle this a unit test is needed to cover the case.
  • If we decide that erroring is the right handling we should use an error message that guides the user to why the parsing failed so they can correct the configuration file.

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