diff options
author | Jeremy Allison <jra@samba.org> | 2002-07-19 19:56:27 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-07-19 19:56:27 +0000 |
commit | 3c9e5a94165afc30ba719aad513e09ead83276fb (patch) | |
tree | 7d1adf5d79cf35a17b82adb0cb1d3a678bec1531 /source3/lib | |
parent | 9fe3bd1259e7bda901f7a264bd7fc88c72d2112f (diff) | |
download | samba-3c9e5a94165afc30ba719aad513e09ead83276fb.tar.gz samba-3c9e5a94165afc30ba719aad513e09ead83276fb.tar.xz samba-3c9e5a94165afc30ba719aad513e09ead83276fb.zip |
Never ignore valgrind messages :-). Don't reference before the start
of a string....
Jeremy.
(This used to be commit 35f0fbd254c222d015bdc582277b90efbaade81e)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_str.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |