Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/smbfs/mount_smbfs do not initialize/use member 'mount_p...



details:   https://anonhg.NetBSD.org/src/rev/648a4352094f
branches:  trunk
changeset: 543359:648a4352094f
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Feb 23 22:14:09 2003 +0000

description:
do not initialize/use member 'mount_point' of struct smbfs_args
allocate mount_point[] on stack

diffstat:

 dist/smbfs/mount_smbfs/mount_smbfs.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (47 lines):

diff -r f563f0f5a114 -r 648a4352094f dist/smbfs/mount_smbfs/mount_smbfs.c
--- a/dist/smbfs/mount_smbfs/mount_smbfs.c      Sun Feb 23 22:05:35 2003 +0000
+++ b/dist/smbfs/mount_smbfs/mount_smbfs.c      Sun Feb 23 22:14:09 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mount_smbfs.c,v 1.2 2003/02/18 09:53:55 jdolecek Exp $ */
+/* $NetBSD: mount_smbfs.c,v 1.3 2003/02/23 22:14:09 jdolecek Exp $ */
 
 /*
  * Copyright (c) 2000-2002, Boris Popov
@@ -59,10 +59,9 @@
 
 #include "mntopts.h"
 
-static char mount_point[MAXPATHLEN + 1];
 static void usage(void);
 
-const static struct mntopt mopts[] = {
+static const struct mntopt mopts[] = {
        MOPT_STDOPTS,
        { NULL, 0, 0, 0 }
 };
@@ -76,7 +75,7 @@
        struct stat st;
        char *next;
        int opt, error, mntflags, caseopt;
-
+       char mount_point[MAXPATHLEN + 1];
 
        if (argc == 2) {
                if (strcmp(argv[1], "-h") == 0) {
@@ -232,14 +231,13 @@
        if (error) {
                exit(1);
        }
-       strcpy(mdata.mount_point,mount_point);
        mdata.version = SMBFS_VERSION;
        mdata.dev = ctx->ct_fd;
        mdata.caseopt = caseopt;
-       error = mount(SMBFS_VFSNAME, mdata.mount_point, mntflags, (void*)&mdata);
+       error = mount(SMBFS_VFSNAME, mount_point, mntflags, (void*)&mdata);
        smb_ctx_done(ctx);
        if (error) {
-               smb_error("mount error: %s", error, mdata.mount_point);
+               smb_error("mount error: %s", error, mount_point);
                exit(1);
        }
        return 0;



Home | Main Index | Thread Index | Old Index