Subject: bin/249: dumpfs can coredump
To: None <gnats-admin>
From: Giles Lean <giles@maenor.apana.org.au>
List: netbsd-bugs
Date: 05/13/1994 18:50:18
>Number:         249
>Category:       bin
>Synopsis:       dumpfs will core dump with floating point exception
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 13 18:50:15 1994
>Originator:     Giles Lean
>Organization:
<giles@maenor.apana.org.au>     +61 3 480 2118 (h)
			 	+61 3 272 2519 (w)
>Release:        -current (6th April)
>Environment:
Clone 486
System: NetBSD maenor.apana.org.au 0.9a MAENOR#2 i386


>Description:
	The dumpfs program makes no attempt to ensure that it has
	a valid filesystem before calculating values, leading to
	division by zero.
>How-To-Repeat:
	Run dumpfs on a swap partition
>Fix:
*** /usr/src/sbin/dumpfs/dumpfs.c	Fri Dec 17 17:35:07 1993
--- ./dumpfs.c	Sat May 14 10:32:57 1994
***************
*** 101,106 ****
--- 101,112 ----
  		perror(name);
  		return;
  	}
+ 	if (afs.fs_magic != FS_MAGIC) {
+ 		fprintf(stderr,
+ 		    "dumpfs: %s: superblock magic number 0x%x, not 0x%x.\n",
+ 			name, afs.fs_magic, FS_MAGIC);
+ 		return;
+ 	}
  	if (afs.fs_postblformat == FS_42POSTBLFMT)
  		afs.fs_nrpos = 8;
  	dev_bsize = afs.fs_fsize / fsbtodb(&afs, 1);
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------