internal: fix nil pointer dereference in ldap outpost

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-05-21 15:48:50 +02:00
parent ebb44c992b
commit 5c91658484
6 changed files with 16 additions and 13 deletions

View File

@ -48,8 +48,8 @@ func (sb *SessionBinder) Bind(username string, req *bind.Request) (ldap.LDAPResu
result, err := sb.DirectBinder.Bind(username, req)
// Only cache the result if there's been an error
if err == nil {
flags, ok := sb.si.GetFlags(req.BindDN)
if !ok {
flags := sb.si.GetFlags(req.BindDN)
if flags == nil {
sb.log.Error("user flags not set after bind")
return result, err
}