summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/replace/replace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/lib/replace/replace.c b/source3/lib/replace/replace.c
index 2c3f14c2df..106c9dfe62 100644
--- a/source3/lib/replace/replace.c
+++ b/source3/lib/replace/replace.c
@@ -82,6 +82,9 @@ size_t rep_strlcat(char *d, const char *s, size_t bufsize)
size_t ret = len1 + len2;
if (len1+len2 >= bufsize) {
+ if (bufsize < (len1+1)) {
+ return ret;
+ }
len2 = bufsize - (len1+1);
}
if (len2 > 0) {