Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Sep 2005 19:05:50 +0200 (CEST)
From:      Ulrich Spoerlein <q@galgenberg.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/86639: [MAINTAINER] sysutils/symon: Fix uninitialized variables
Message-ID:  <200509271705.j8RH5oF6007155@roadrunner.q.local>
Resent-Message-ID: <200509271710.j8RHAGdh076288@freefall.freebsd.org>

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

>Number:         86639
>Category:       ports
>Synopsis:       [MAINTAINER] sysutils/symon: Fix uninitialized variables
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 27 17:10:15 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Ulrich Spoerlein
>Release:        FreeBSD 6.0-BETA5 i386
>Organization:
>Environment:
System: FreeBSD roadrunner 6.0-BETA5 FreeBSD 6.0-BETA5 #1: Tue Sep 20 21:30:40 CEST 2005
>Description:
Fixes uninitialized variables. They are only *incremented* in
the loop. And if the loop never runs, their value is unspecified.

Added file(s):
- files/patch-sm_mem.c

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- symon-2.71.patch begins here ---
Index: files/patch-sm_mem.c
===================================================================
RCS file: files/patch-sm_mem.c
diff -N files/patch-sm_mem.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-sm_mem.c	27 Sep 2005 17:01:34 -0000
@@ -0,0 +1,19 @@
+--- platform/FreeBSD/sm_mem.c.orig	Tue Sep 27 18:32:40 2005
++++ platform/FreeBSD/sm_mem.c	Tue Sep 27 19:00:29 2005
+@@ -119,6 +119,7 @@
+     me_stats[1] = pagetob(me_vmtotal.t_rm);
+     me_stats[2] = pagetob(me_vmtotal.t_free);
+ 
++    me_stats[3] = me_stats[4] = 0;
+ #ifdef HAS_XSWDEV
+     vmnswp_siz = sizeof (int);
+     if (sysctl(me_vmnswp_mib_nam, me_vmnswp_mib_len, &vmnswp_dat, (void *)&vmnswp_siz, NULL, 0) < 0) {
+@@ -134,8 +135,6 @@
+ 	me_stats[3] += (vmiswp_dat.xsw_used * DEV_BSIZE);
+ 	me_stats[4] += (vmiswp_dat.xsw_nblks * DEV_BSIZE);
+     }
+-#else
+-    me_stats[3] = me_stats[4] = 0;
+ #endif
+ 
+     return snpack(symon_buf, maxlen, s, MT_MEM,
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/symon/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	13 May 2005 20:17:26 -0000	1.4
+++ Makefile	27 Sep 2005 17:04:20 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	symon
 PORTVERSION=	2.71
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	http://www.xs4all.nl/~wpd/symon/philes/
 
--- symon-2.71.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



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