outposts/ldap: avoid nil ptr deref in MemorySearcher (#7767)
This commit is contained in:
parent
893b8376cf
commit
60c49c1692
|
@ -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 := api.NewGroup(g.Pk, g.NumPk, g.Name, g.ParentName, []api.GroupMember{u}, []api.Role{})
|
||||||
fg.SetUsers([]int32{flag.UserPk})
|
fg.SetUsers([]int32{flag.UserPk})
|
||||||
if g.Parent.IsSet() {
|
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.SetAttributes(g.Attributes)
|
||||||
fg.SetIsSuperuser(*g.IsSuperuser)
|
fg.SetIsSuperuser(*g.IsSuperuser)
|
||||||
|
|
Reference in New Issue