From c2f3ce11b063eb41e80712670a2d4f66d6c3946d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 26 Sep 2021 14:52:25 +0200 Subject: [PATCH] outposts/ldap: fix potential panic when converting attributes Signed-off-by: Jens Langhammer --- internal/outpost/ldap/utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/outpost/ldap/utils.go b/internal/outpost/ldap/utils.go index a2167a5ee..d6086f415 100644 --- a/internal/outpost/ldap/utils.go +++ b/internal/outpost/ldap/utils.go @@ -39,6 +39,9 @@ func ldapResolveTypeSingle(in interface{}) *string { func AKAttrsToLDAP(attrs interface{}) []*ldap.EntryAttribute { attrList := []*ldap.EntryAttribute{} + if attrs == nil { + return attrList + } a := attrs.(*map[string]interface{}) for attrKey, attrValue := range *a { entry := &ldap.EntryAttribute{Name: attrKey}