From 77916f652fba812287541ab0d6a5ed203852cd3d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Mar 2003 18:10:36 +0000 Subject: Fix up zero termination. Spotted by Sebastian Krahmer . Jeremy. (This used to be commit 69becdb563b2620513931811a6695481bebcceed) --- source3/smbd/quotas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3') 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)); -- cgit