Subject: port-i386/6682: Uninitialized variable in installboot
To: None <gnats-bugs@gnats.netbsd.org>
From: None <eramer@era-t.ericsson.se>
List: netbsd-bugs
Date: 12/29/1998 21:39:38
>Number:         6682
>Category:       port-i386
>Synopsis:       Uninitialized variable in installboot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer (NetBSD/i386 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 29 13:05:01 1998
>Last-Modified:
>Originator:     Michael Eriksson
>Organization:
Michael Eriksson <eramer@era-t.ericsson.se>
>Release:        -current of 981226
>Environment:

>Description:

Gcc 2.7.2 complains about uninitialized variable when compiling
sys/arch/i386/stand/installboot/installboot.c. Code inspection shows
that gcc is correct.

>How-To-Repeat:

Compile with gcc 2.7.2

>Fix:

I haven't analyzed the logic of the program, so this patch is probably
wrong, but at least it shows where the problem is.

--- sys/arch/i386/stand/installboot/installboot.c.orig	Sun Dec 20 13:16:06 1998
+++ sys/arch/i386/stand/installboot/installboot.c	Tue Dec 29 14:26:50 1998
@@ -333,7 +333,8 @@
 
 		if (setup_ffs_blks(diskdev, inode))
 			return (-1);
-	}
+	} else
+		inode = 0;
 	return inode;
 }
 
>Audit-Trail:
>Unformatted: