Skip to content

Commit

Permalink
outposts/ldap: avoid nil ptr deref in MemorySearcher (#7767)
Browse files Browse the repository at this point in the history
  • Loading branch information
slrz authored Dec 4, 2023
1 parent 893b837 commit 60c49c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/outpost/ldap/search/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ func (ms *MemorySearcher) Search(req *search.Request) (ldap.ServerSearchResult,
fg := api.NewGroup(g.Pk, g.NumPk, g.Name, g.ParentName, []api.GroupMember{u}, []api.Role{})
fg.SetUsers([]int32{flag.UserPk})
if g.Parent.IsSet() {
fg.SetParent(*g.Parent.Get())
if p := g.Parent.Get(); p != nil {
fg.SetParent(*p)
} else {
fg.SetParentNil()
}
}
fg.SetAttributes(g.Attributes)
fg.SetIsSuperuser(*g.IsSuperuser)
Expand Down

0 comments on commit 60c49c1

Please sign in to comment.