From e7ded9d6b575870a17ce58f0192cc388984dfb4a Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 27 Jan 2020 16:39:08 +0100 Subject: [PATCH] Fix slice bounds --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index a8acc18..bc81384 100644 --- a/main.go +++ b/main.go @@ -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) }