diff --git a/CHANGES b/CHANGES
index 8b317ed4b605359ceff0c427a07dd1f777588292..7dba74a5b223d301a0ee344397d93b1cfa3155e5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,7 @@ OpenLDAP 2.4.18 Engineering
 	Fixed slapd tools to properly close database (ITS#6214)
 	Fixed slapd-ndb startup (ITS#6203)
 	Fixed slapo-unique filter matching (ITS#6077)
+	Fixed tools off by one error (ITS#6233)
 	Fixed tools resource leaks (ITS#6145)
 	Fixed contrib/autogroup with RE24 (ITS#6227)
 	Build Environment
diff --git a/clients/tools/common.c b/clients/tools/common.c
index a75f8bfe98d0d4f289e85a6bcd617a81b81f63b9..c39b9c1a2154c2fbebf1adf93bd5065317e5d6b9 100644
--- a/clients/tools/common.c
+++ b/clients/tools/common.c
@@ -2049,7 +2049,7 @@ print_deref( LDAP *ld, LDAPControl *ctrl )
 		}
 		ptr = lutil_strncopy( ptr, dr->derefVal.bv_val, dr->derefVal.bv_len );
 		*ptr++ = '\n';
-		*ptr++ = '\0';
+		*ptr = '\0';
 		assert( ptr <= buf + len );
 
 		tool_write_ldif( LDIF_PUT_COMMENT, NULL, buf, ptr - buf);