Skip to content

Commit

Permalink
Fix panic in case of one line realm configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Olga Batyshkina committed Sep 9, 2021
1 parent 663478b commit ddd1854
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/krb5conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ func parseRealms(lines []string) (realms []Realm, err error) {
}
c--
if c == 0 {
if start == i {
return nil, errors.New("invalid Realms section in configuration")
}
var r Realm
e := r.parseLines(name, lines[start+1:i])
if e != nil {
Expand Down
3 changes: 3 additions & 0 deletions v8/config/krb5conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ func parseRealms(lines []string) (realms []Realm, err error) {
}
c--
if c == 0 {
if start == i {
return nil, errors.New("invalid Realms section in configuration")
}
var r Realm
e := r.parseLines(name, lines[start+1:i])
if e != nil {
Expand Down

0 comments on commit ddd1854

Please sign in to comment.