From owner-freebsd-audit Mon Oct 9 11: 4:17 2000 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id A705237B66E for ; Mon, 9 Oct 2000 11:04:15 -0700 (PDT) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id e99I4Et152467 for ; Mon, 9 Oct 2000 14:04:14 -0400 (EDT) Received: from muriel.penguinpowered.com ([198.82.100.195]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0G2600IH4CV2IY@gkar.cc.vt.edu> for FreeBSD-audit@freebsd.org; Mon, 9 Oct 2000 14:04:14 -0400 (EDT) Date: Mon, 09 Oct 2000 13:59:18 -0400 (EDT) From: Mike Heffner Subject: mount_mfs (newfs) overflow fix To: FreeBSD-audit Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.4 on FreeBSD Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 8bit X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Also fixes a potential uninitialized variable problem. --- newfs.c.orig Mon Oct 9 13:50:11 2000 +++ newfs.c Mon Oct 9 13:37:10 2000 @@ -167,7 +167,7 @@ #define NSECTORS 4096 /* number of sectors */ -int mfs; /* run as the memory based filesystem */ +int mfs = 0; /* run as the memory based filesystem */ char *mfs_mtpt; /* mount point for mfs */ struct stat mfs_mtstat; /* stat prior to mount */ int Nflag; /* run without writing file system */ @@ -408,7 +408,7 @@ /* * No path prefix; try /dev/%s. */ - (void)sprintf(device, "%s%s", _PATH_DEV, special); + (void)snprintf(device, sizeof(device), "%s%s", _PATH_DEV, special); special = device; } if (Nflag) { -- Mike Heffner Fredericksburg, VA ICQ# 882073 http://my.ispchannel.com/~mheffner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message