From 15539710a08b5a88577000487fa9a6866ee615a0 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 16 Nov 1995 04:34:13 +0000 Subject: [PATCH] Clear the mount argument list before filling it in. This is the patch from Michael Hitch in pr#1722. As noted in the pr, this may not be the most correct fix, but at least it prevents crashes. --- sbin/mountd/mountd.c | 5 +++-- usr.sbin/mountd/mountd.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index ec40a11ca179..2db778627045 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $NetBSD: mountd.c,v 1.28 1995/11/06 07:00:07 thorpej Exp $ */ +/* $NetBSD: mountd.c,v 1.29 1995/11/16 04:34:13 thorpej Exp $ */ /* * Copyright (c) 1989, 1993 @@ -46,7 +46,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mountd.c 8.8 (Berkeley) 2/20/94"; #else -static char rcsid[] = "$NetBSD: mountd.c,v 1.28 1995/11/06 07:00:07 thorpej Exp $"; +static char rcsid[] = "$NetBSD: mountd.c,v 1.29 1995/11/16 04:34:13 thorpej Exp $"; #endif #endif /* not lint */ @@ -650,6 +650,7 @@ get_exportlist() !strncmp(fsp->f_fstypename, MOUNT_MSDOS, MFSNAMELEN) || !strncmp(fsp->f_fstypename, MOUNT_ADOSFS, MFSNAMELEN) || !strncmp(fsp->f_fstypename, MOUNT_CD9660, MFSNAMELEN)) { + bzero((char *)&targs, sizeof(targs)); targs.ua.fspec = NULL; targs.ua.export.ex_flags = MNT_DELEXPORT; if (mount(fsp->f_fstypename, fsp->f_mntonname, diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index ec40a11ca179..2db778627045 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $NetBSD: mountd.c,v 1.28 1995/11/06 07:00:07 thorpej Exp $ */ +/* $NetBSD: mountd.c,v 1.29 1995/11/16 04:34:13 thorpej Exp $ */ /* * Copyright (c) 1989, 1993 @@ -46,7 +46,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mountd.c 8.8 (Berkeley) 2/20/94"; #else -static char rcsid[] = "$NetBSD: mountd.c,v 1.28 1995/11/06 07:00:07 thorpej Exp $"; +static char rcsid[] = "$NetBSD: mountd.c,v 1.29 1995/11/16 04:34:13 thorpej Exp $"; #endif #endif /* not lint */ @@ -650,6 +650,7 @@ get_exportlist() !strncmp(fsp->f_fstypename, MOUNT_MSDOS, MFSNAMELEN) || !strncmp(fsp->f_fstypename, MOUNT_ADOSFS, MFSNAMELEN) || !strncmp(fsp->f_fstypename, MOUNT_CD9660, MFSNAMELEN)) { + bzero((char *)&targs, sizeof(targs)); targs.ua.fspec = NULL; targs.ua.export.ex_flags = MNT_DELEXPORT; if (mount(fsp->f_fstypename, fsp->f_mntonname,