bin/71670: [PATCH] usr.sbin/asf may use uninialised variables

Dan Lukes dan at obluda.cz
Sun Sep 12 10:40:28 PDT 2004


>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:


More information about the freebsd-bugs mailing list