summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/common/attrib_handlers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/attrib_handlers.c b/source4/lib/ldb/common/attrib_handlers.c
index 7d1eff6d9a..ec89bdd1c4 100644
--- a/source4/lib/ldb/common/attrib_handlers.c
+++ b/source4/lib/ldb/common/attrib_handlers.c
@@ -69,7 +69,7 @@ static int ldb_handler_fold(struct ldb_context *ldb, void *mem_ctx,
/* remove trailing spaces if any */
l = strlen(s);
- while (s[l - 1] == ' ') l--;
+ while (l > 0 && s[l - 1] == ' ') l--;
s[l] = '\0';
/* remove leading spaces if any */