summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-03-11 18:10:27 +0000
committerJeremy Allison <jra@samba.org>2003-03-11 18:10:27 +0000
commit71708c9c077704f7aeadd2abf2b543f4dbec1b40 (patch)
tree1ae000b6d1a5f898fbd60deeef4790f947a61850 /source3
parentd606f8cb1eb69d897400c3a4f9c6813150d53c3a (diff)
downloadsamba-71708c9c077704f7aeadd2abf2b543f4dbec1b40.tar.gz
samba-71708c9c077704f7aeadd2abf2b543f4dbec1b40.tar.bz2
samba-71708c9c077704f7aeadd2abf2b543f4dbec1b40.zip
Fix up zero termination. Spotted by Sebastian Krahmer <krahmer@suse.de>.
Jeremy. (This used to be commit 289e2e25b91da20ac02b90e5a9d6de3619ad308d)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/quotas.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 9d3bfe2d64..c2f001423e 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -413,10 +413,11 @@ static BOOL nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
len=strcspn(mnttype, ":");
pathname=strstr(mnttype, ":");
- cutstr = (char *) malloc(sizeof(char) * len );
+ cutstr = (char *) malloc(len+1);
if (!cutstr)
return False;
+ memset(cutstr, '\0', len+1);
host = strncat(cutstr,mnttype, sizeof(char) * len );
DEBUG(5,("nfs_quotas: looking for mount on \"%s\"\n", cutstr));
DEBUG(5,("nfs_quotas: of path \"%s\"\n", mnttype));