aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-01-27 16:39:08 +0100
committerAlex Auvolat <alex@adnab.me>2020-01-27 16:39:08 +0100
commite7ded9d6b575870a17ce58f0192cc388984dfb4a (patch)
treed1fd9fae3b1c32cb6d656b9145e61c9d88ead4b9 /main.go
parentdce432426e325ab43757da9485c612421c912957 (diff)
downloadbottin-e7ded9d6b575870a17ce58f0192cc388984dfb4a.tar.gz
bottin-e7ded9d6b575870a17ce58f0192cc388984dfb4a.zip
Fix slice bounds
Diffstat (limited to 'main.go')
-rw-r--r--main.go2
1 files changed, 1 insertions, 1 deletions
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)
}