summaryrefslogtreecommitdiff
path: root/source3/lib/replace
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-07-02 11:57:13 -0700
committerJeremy Allison <jra@samba.org>2008-07-02 11:57:13 -0700
commit4b88ff157d3b0f3fd8cb0cafbe01c331678491b7 (patch)
tree5755d7f755c8897303aee2e0a60f39da6d6bdb0e /source3/lib/replace
parent765c3b953db8e4ab84fcfdce9d86356436a10f5b (diff)
downloadsamba-4b88ff157d3b0f3fd8cb0cafbe01c331678491b7.tar.gz
samba-4b88ff157d3b0f3fd8cb0cafbe01c331678491b7.tar.bz2
samba-4b88ff157d3b0f3fd8cb0cafbe01c331678491b7.zip
Fix bug #5578, reported by sendel2000@hotbox.ru. Bad (non-Samba) use of strlcat gives error.
Jeremy. (This used to be commit d7c82997bdcf1acd7ac104efa0ad05e0b94935ea)
Diffstat (limited to 'source3/lib/replace')
-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) {