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 authored and jcmturner committed Jun 14, 2022
1 parent b3564a0 commit ff959ff
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 ff959ff

Please sign in to comment.