Subject: bin/22862: uninitialized var in pkg_install/admin/main.c:add1pkg()
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 09/19/2003 13:20:39
>Number:         22862
>Category:       bin
>Synopsis:       uninitialized var in pkg_install/admin/main.c:add1pkg()
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 19 17:21:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        NetBSD-current 2003/09/18
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD
Architecture: sparc
Machine: sparc
>Description:

	there's an uninitialized variable in pkg_install/admin/main.c:add1pkg()

>How-To-Repeat:

	# pkg_admin rebuild
	.....................
	Stored -1958998933 files from 30 packages in /var/db/pkg/pkgdb.byfile.db.
	Done.

>Fix:

Index: main.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/usr.sbin/pkg_install/admin/main.c,v
retrieving revision 1.40
diff -c -c -r1.40 main.c
*** main.c	13 Sep 2003 05:48:50 -0000	1.40
--- main.c	19 Sep 2003 17:15:51 -0000
***************
*** 166,172 ****
  	char	       *PkgDBDir, *PkgName, *dirp;
  	char 		file[FILENAME_MAX];
  	char		dir[FILENAME_MAX];
! 	int		cnt;
  
  	if (!pkgdb_open(ReadWrite))
  		err(EXIT_FAILURE, "cannot open pkgdb");
--- 166,172 ----
  	char	       *PkgDBDir, *PkgName, *dirp;
  	char 		file[FILENAME_MAX];
  	char		dir[FILENAME_MAX];
! 	int		cnt = 0;
  
  	if (!pkgdb_open(ReadWrite))
  		err(EXIT_FAILURE, "cannot open pkgdb");
>Release-Note:
>Audit-Trail:
>Unformatted: