summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-02-06 00:27:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:49 -0500
commit5b26ea841cb87500d46cb39ee05000994bcfccbe (patch)
tree4966caef380ce718998938874d2d2ea94fbee076 /source4/lib/ldb/common
parent00c05456657f3219fc903463e57f1d0398232e78 (diff)
downloadsamba-5b26ea841cb87500d46cb39ee05000994bcfccbe.tar.gz
samba-5b26ea841cb87500d46cb39ee05000994bcfccbe.tar.bz2
samba-5b26ea841cb87500d46cb39ee05000994bcfccbe.zip
r13359: make sure we don't look at s[-1]
metze (This used to be commit 24c6e2f73175befa33f9758634e3ee183916e387)
Diffstat (limited to 'source4/lib/ldb/common')
-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 */