summaryrefslogtreecommitdiff
path: root/source3/client
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/client
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/client')
-rw-r--r--source3/client/mount.cifs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index ea254b6047..72ef9febe0 100644
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -115,6 +115,9 @@ size_t 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) {