Fix slice bounds

This commit is contained in:
Alex 2020-01-27 16:39:08 +01:00
parent dce432426e
commit e7ded9d6b5

View file

@ -357,7 +357,7 @@ func (server *Server) objectExists(dn string) (bool, error) {
func (server *Server) checkSuffix(dn string, allow_extend bool) (string, error) {
suffix := server.config.Suffix
if len(dn) < len(suffix) {
if dn != suffix[-len(dn):] || !allow_extend {
if dn != suffix[len(suffix)-len(dn):] || !allow_extend {
return suffix, fmt.Errorf(
"Only handling stuff under DN %s", suffix)
}