mirror of
https://github.com/minio/minio.git
synced 2025-03-13 21:12:55 -04:00
Fix nil pointer deref in PeerPolicyMappingHandler (#20913)
The following lines will attempt to de-reference the nil value. Instead just return the error at once.
This commit is contained in:
parent
f00c8c4cce
commit
e30f1ad7bd
@ -1441,7 +1441,7 @@ func (c *SiteReplicationSys) PeerPolicyMappingHandler(ctx context.Context, mappi
|
||||
if foundGroupDN, underBaseDN, err = globalIAMSys.LDAPConfig.GetValidatedGroupDN(nil, entityName); err != nil {
|
||||
iamLogIf(ctx, err)
|
||||
} else if foundGroupDN == nil || !underBaseDN {
|
||||
err = errNoSuchGroup
|
||||
return wrapSRErr(errNoSuchGroup)
|
||||
}
|
||||
entityName = foundGroupDN.NormDN
|
||||
} else {
|
||||
@ -1449,7 +1449,7 @@ func (c *SiteReplicationSys) PeerPolicyMappingHandler(ctx context.Context, mappi
|
||||
if foundUserDN, err = globalIAMSys.LDAPConfig.GetValidatedDNForUsername(entityName); err != nil {
|
||||
iamLogIf(ctx, err)
|
||||
} else if foundUserDN == nil {
|
||||
err = errNoSuchUser
|
||||
return wrapSRErr(errNoSuchUser)
|
||||
}
|
||||
entityName = foundUserDN.NormDN
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user