summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2004-03-19 11:27:14 +0000
committerSimo Sorce <idra@samba.org>2004-03-19 11:27:14 +0000
commit9915ded60a1c59528ab6485dc14ac34f19f6153f (patch)
tree0974ad904968ae8a34b1cc68e33b2e65abb59e06
parent7ff5b737d8e93ef06f40647ac4d108630d436616 (diff)
downloadsamba-9915ded60a1c59528ab6485dc14ac34f19f6153f.tar.gz
samba-9915ded60a1c59528ab6485dc14ac34f19f6153f.tar.bz2
samba-9915ded60a1c59528ab6485dc14ac34f19f6153f.zip
the buffer must be greater then src string len otherwise bad things happen!
(This used to be commit 83213238c2f1541a0520175abfdb1f884e06a018)
-rw-r--r--source3/lib/replace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c
index cd48b8d160..fe1cfc04eb 100644
--- a/source3/lib/replace.c
+++ b/source3/lib/replace.c
@@ -65,6 +65,9 @@ ftruncate for operating systems that don't have it
size_t len2 = strlen(s);
size_t ret = len1 + len2;
+ if (len1 >= bufsize) {
+ return 0;
+ }
if (len1+len2 >= bufsize) {
len2 = bufsize - (len1+1);
}