From 5b26ea841cb87500d46cb39ee05000994bcfccbe Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 6 Feb 2006 00:27:02 +0000 Subject: r13359: make sure we don't look at s[-1] metze (This used to be commit 24c6e2f73175befa33f9758634e3ee183916e387) --- source4/lib/ldb/common/attrib_handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/ldb/common/attrib_handlers.c') 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 */ -- cgit