Subject: bin/18455: latest du(1) change cause du to dump core
To: None <gnats-bugs@gnats.netbsd.org>
From: Benedikt Meurer <bmeurer@fwdn.de>
List: netbsd-bugs
Date: 09/28/2002 22:53:39
>Number:         18455
>Category:       bin
>Synopsis:       latest du(1) change cause du to dump core
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 28 13:54:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Benedikt Meurer
>Release:        NetBSD 1.6
>Organization:
University Siegen
>Environment:
	
	
System: NetBSD endor.kosmos.all 1.6 NetBSD 1.6 (ENDOR) #0: Fri Sep 27 16:35:03 CEST 2002 benny@darkstar.kosmos.all:/usr/src/sys/arch/i386/compile/ENDOR i386
Architecture: i386
Machine: i386
>Description:
latest change to du(1) causes it to dump core on a divide-by-null, cause
blocksize is now defined twice, once global (as needed) and once in
main, so any changes to blocksize won't affect the global blocksize var,
which stays 0. Also totalblocks should be of type int64_t to allow du(1)
to manage large files.
>How-To-Repeat:
get latest du(1) from current, compile and run _without_ -h flag.
>Fix:
Apply the following patch:

Index: du.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/du/du.c,v
retrieving revision 1.18
diff -r1.18 du.c
81c81
< 	long blocksize, totalblocks;
---
> 	int64_t totalblocks;
>Release-Note:
>Audit-Trail:
>Unformatted: