Fix up zero termination. Spotted by Sebastian Krahmer <krahmer@suse.de>.
authorJeremy Allison <jra@samba.org>
Tue, 11 Mar 2003 18:10:36 +0000 (18:10 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 11 Mar 2003 18:10:36 +0000 (18:10 +0000)
Jeremy.
(This used to be commit 69becdb563b2620513931811a6695481bebcceed)

source3/smbd/quotas.c

index 9d3bfe2d64d0351af5494f962fe7c3fd0b8a9056..c2f001423e13bcca3a273c59f770d5cb33467312 100644 (file)
@@ -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));