Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Oct 2000 16:23:24 -0400 (EDT)
From:      Mike Heffner <mheffner@vt.edu>
To:        Warner Losh <imp@village.org>
Cc:        FreeBSD-audit <FreeBSD-audit@FreeBSD.ORG>
Subject:   Re: mount_mfs (newfs) overflow fix
Message-ID:  <XFMail.20001009162324.mheffner@vt.edu>
In-Reply-To: <200010091817.MAA13523@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 09-Oct-2000 Warner Losh wrote:
| : --- 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 */
|  
|  This is a null change.  mfs already, per the C standard, is guaranteed 
|  to be initialized to 0.  As it isn't an automatic variable, its
|  initialization value is known.  Adding the = 0 will increase the data
|  segment by 4 bytes, which increases the file size by 4 bytes because
|  initialized data is stored in the binary, while bss data isn't.

Didn't realize that, forget that part then.

|  
| : -               (void)sprintf(device, "%s%s", _PATH_DEV, special);
| : +               (void)snprintf(device, sizeof(device), "%s%s", _PATH_DEV,
|  
|  This almost certainly is harmless.  However, it likely is a good
|  change.
|  

I made the change so that it couldn't be overflowed from the command line
arguments.


-- 
  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.20001009162324.mheffner>