Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Sep 2004 19:36:41 +0200 (CEST)
From:      Dan Lukes <dan@obluda.cz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/71670: [PATCH] usr.sbin/asf may use uninialised variables
Message-ID:  <200409121736.i8CHafpO010921@kulesh.obluda.cz>
Resent-Message-ID: <200409121740.i8CHeR8h009167@freefall.freebsd.org>

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

>Number:         71670
>Category:       bin
>Synopsis:       [PATCH] usr.sbin/asf may use uninialised variables
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 17:40:27 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
Obludarium
>Environment:
System: FreeBSD 5.3-BETA3 #8: Sun Sep 5 07:06:40 CEST 2004 i386
usr.sbin/asf/asf.c,v 1.6 2003/11/04 06:38:37 green

>Description:
usr.sbin/asf/asf.c:245: warning: 'textaddr' might be used uninitialized in this function
usr.sbin/asf/asf.c:246: warning: 'dataaddr' might be used uninitialized in this function
usr.sbin/asf/asf.c:247: warning: 'bssaddr' might be used uninitialized in this function

Those warnings are real bugs. When output of objdump doesn't contain
information about .text or .data or .bss section then corresponding variable
remain uninitialized, but used.

>How-To-Repeat:
	N/A
>Fix:
*** usr.sbin/asf/asf.c.ORIG	Fri Nov 14 03:53:00 2003
--- usr.sbin/asf/asf.c	Sun Sep 12 17:33:13 2004
***************
*** 242,250 ****
  	if ((!(strstr(buf, "kernel")))
  	    && buf[0] != 'I') {
  	    quad_t base;
! 	    quad_t textaddr;
! 	    quad_t dataaddr;
! 	    quad_t bssaddr;
  
  	    tokens = tokenize(buf, token, MAXTOKEN);
  	    base = strtoll(token[2], NULL, 16);
--- 242,250 ----
  	if ((!(strstr(buf, "kernel")))
  	    && buf[0] != 'I') {
  	    quad_t base;
! 	    quad_t textaddr = 0;
! 	    quad_t dataaddr = 0;
! 	    quad_t bssaddr = 0;
  
  	    tokens = tokenize(buf, token, MAXTOKEN);
  	    base = strtoll(token[2], NULL, 16);
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409121736.i8CHafpO010921>