summaryrefslogtreecommitdiff
path: root/source4/lib/replace
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-07-02 12:01:15 -0700
committerJeremy Allison <jra@samba.org>2008-07-02 12:01:15 -0700
commitd8ac9bde86f349fecb997a2c8c4d0e2cbfe22542 (patch)
tree59c8f82acf94d19f90a2b226cbbfa6f3642ff2ee /source4/lib/replace
parentb8d3ef1772c319cdc468522ea5355d0d689ef5f1 (diff)
downloadsamba-d8ac9bde86f349fecb997a2c8c4d0e2cbfe22542.tar.gz
samba-d8ac9bde86f349fecb997a2c8c4d0e2cbfe22542.tar.bz2
samba-d8ac9bde86f349fecb997a2c8c4d0e2cbfe22542.zip
Fix bug #5578, reported by sendel2000@hotbox.ru. Bad (non-Samba) use of strlcat gives error.
Jeremy. (This used to be commit e633dc4ec2d72c3d34b5e096e0460e07e07ab514)
Diffstat (limited to 'source4/lib/replace')
-rw-r--r--source4/lib/replace/replace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c
index 2c3f14c2df..106c9dfe62 100644
--- a/source4/lib/replace/replace.c
+++ b/source4/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) {