Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2011 03:00:39 GMT
From:      moto kawasaki <moto@kawasaki3.org>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/163084: net-mgmt/bsnmptools fails to build 
Message-ID:  <201112300300.pBU30dA6008375@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/163084; it has been noted by GNATS.

From: moto kawasaki <moto@kawasaki3.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/163084: net-mgmt/bsnmptools fails to build 
Date: Fri, 30 Dec 2011 11:51:34 +0900 (JST)

 Hi,
 
 I'd report quick patch for uninitialized variable 'value' problem.
 
 
 The problem reported in ports/163084 was reproduced in my environment.
 (cd /usr/ports && make update has done in a few days ago)
 
 ==================================================
 # uname -srm
 FreeBSD 8.2-RELEASE-p5 amd64
 # pwd
 /usr/ports/net-mgmt/bsnmptools/work/bsnmptools/lib
 # make
 Warning: Object directory not changed from original /usr/ports/net-mgmt/bsnmptools/work/bsnmptools/lib
 cc -O2 -fno-strict-aliasing -pipe -march=nocona -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c bsnmptools.c
 cc1: warnings being treated as errors
 bsnmptools.c: In function 'parse_include':
 bsnmptools.c:399: warning: 'value' may be used uninitialized in this function
 *** Error code 1
 
 Stop in /usr/ports/net-mgmt/bsnmptools/work/bsnmptools/lib.
 ==================================================
 
 
 
 
 
 
 Now, this 'value' can be initialized in getsubopt1() in the same
 source file, and the above compile error disappears.
 
 ==================================================
 # diff -u bsnmptools.c.orig bsnmptools.c
 --- bsnmptools.c.orig	2011-12-30 11:38:33.000000000 +0900
 +++ bsnmptools.c	2011-12-30 11:42:16.000000000 +0900
 @@ -256,6 +256,7 @@
  	u_int i;
  	char *ptr;
  
 +	*valp = NULL;
  	*optp = NULL;
  
  	/* skip leading junk */
 ==================================================
 
 Thank you!
 
 
 Best Regards,
 
 
 
 -- 
 moto kawasaki <moto@kawasaki3.org>



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