Date: Mon, 09 Oct 2000 13:59:18 -0400 (EDT) From: Mike Heffner <mheffner@vt.edu> To: FreeBSD-audit <FreeBSD-audit@freebsd.org> Subject: mount_mfs (newfs) overflow fix Message-ID: <XFMail.20001009135918.mheffner@vt.edu>
next in thread | raw e-mail | index | archive | help
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 <mheffner@vt.edu> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20001009135918.mheffner>