From 3c9e5a94165afc30ba719aad513e09ead83276fb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Jul 2002 19:56:27 +0000 Subject: Never ignore valgrind messages :-). Don't reference before the start of a string.... Jeremy. (This used to be commit 35f0fbd254c222d015bdc582277b90efbaade81e) --- source3/lib/util_str.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib') diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 67d3b2108e..1a2c2bef1f 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -299,7 +299,7 @@ BOOL trim_string(char *s,const char *front,const char *back) } if (back_len) { - while (strncmp(s+len-back_len,back,back_len)==0) { + while ((len >= back_len) && strncmp(s+len-back_len,back,back_len)==0) { s[len-back_len]='\0'; len -= back_len; ret=True; -- cgit