summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-09-03 00:56:43 +0000
committerJeremy Allison <jra@samba.org>2003-09-03 00:56:43 +0000
commit9c570af3330f1c59b9eb5a47139d6753a1d292e8 (patch)
treecc9bd88e42df6f0c9d29c9c658ec14290be748f3 /source3/lib
parentd517c1d613d7cace619878ca9853b154aa71dec3 (diff)
downloadsamba-9c570af3330f1c59b9eb5a47139d6753a1d292e8.tar.gz
samba-9c570af3330f1c59b9eb5a47139d6753a1d292e8.tar.bz2
samba-9c570af3330f1c59b9eb5a47139d6753a1d292e8.zip
Fix up overlapping memcpy -> memmove found by valgrind.
Jeremy. (This used to be commit e0c1460c6b6af2b83ea205d8abeb37c71ca1d4c1)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_str.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index c356fdcab7..f036d88da0 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -428,7 +428,9 @@ BOOL trim_string(char *s,const char *front,const char *back)
if (front_len) {
while (len && strncmp(s, front, front_len)==0) {
- memcpy(s, s+front_len, (len-front_len)+1);
+ /* Must use memmove here as src & dest can
+ * easily overlap. Found by valgrind. JRA. */
+ memmove(s, s+front_len, (len-front_len)+1);
len -= front_len;
ret=True;
}