rpms/net-snmp/F-10 net-snmp-5.4.2.1-proc-div0.patch, NONE, 1.1 net-snmp.spec, 1.165, 1.166

Jan Šafránek jsafrane at fedoraproject.org
Mon May 18 10:26:27 UTC 2009


Author: jsafrane

Update of /cvs/pkgs/rpms/net-snmp/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30699

Modified Files:
	net-snmp.spec 
Added Files:
	net-snmp-5.4.2.1-proc-div0.patch 
Log Message:
fix divison-by-zero in cpu statistics
Resolves: #501210

net-snmp-5.4.2.1-proc-div0.patch:

--- NEW FILE net-snmp-5.4.2.1-proc-div0.patch ---
501210:  net-snmp SIGFPE 0x00002aaaab37744a in var_hrproc (vp=0x7fffffffbf50)

Author: Jan Safranek <jsafrane at redhat.com>
Upstream as SVN rev. 17616.

Index: net-snmp/agent/mibgroup/host/hr_proc.c
===================================================================
--- net-snmp/agent/mibgroup/host/hr_proc.c	(revision 17615)
+++ net-snmp/agent/mibgroup/host/hr_proc.c	(working copy)
@@ -182,7 +182,10 @@
             return NULL;
 
         long_return  = (cpu->idle_ticks  - cpu->history[0].idle_hist)*100;
-        long_return /= (cpu->total_ticks - cpu->history[0].total_hist);
+        if (cpu->total_ticks > cpu->history[0].total_hist) /* avoid div. by 0 */
+            long_return /= (cpu->total_ticks - cpu->history[0].total_hist);
+        else
+            long_return = 0; 
         long_return  = 100 - long_return;
         if (long_return < 0)
             long_return = 0;


Index: net-snmp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/F-10/net-snmp.spec,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -p -r1.165 -r1.166
--- net-snmp.spec	16 Feb 2009 11:12:36 -0000	1.165
+++ net-snmp.spec	18 May 2009 10:25:56 -0000	1.166
@@ -8,7 +8,7 @@
 Summary: A collection of SNMP protocol tools and libraries
 Name: net-snmp
 Version: %{major_ver}
-Release: 3%{?dist}
+Release: 4%{?dist}
 Epoch: 1
 
 License: BSD and MIT
@@ -37,6 +37,7 @@ Patch10: net-snmp-5.4.1-shared-ip.patch
 Patch11: net-snmp-5.4.1-sensors3.patch
 Patch12: net-snmp-5.4.1-xen-crash.patch
 Patch13: net-snmp-5.4.1-libwrap.patch
+Patch14: net-snmp-5.4.2.1-proc-div0.patch
 
 Requires(pre): chkconfig
 Requires(post): chkconfig
@@ -177,6 +178,7 @@ Net-SNMP toolkit library.
 %patch11 -p1 -b .sensors
 %patch12 -p1 -b .xen-crash
 %patch13 -p1 -b .libwrap
+%patch14 -p1 -b .proc-div0
 
 # Do this patch with a perl hack...
 perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
@@ -416,6 +418,9 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_datadir}/snmp/mibs
 
 %changelog
+* Mon May 18 2009 Jan Safranek <jsafranek at redhat.com> 5.4.2.1-4
+- fix divison-by-zero in cpu statistics
+
 * Mon Feb 16 2009 Jan Safranek <jsafranek at redhat.com> 5.4.2.1-3
 - fix tcp_wrappers integration (CVE-2008-6123)
 




More information about the scm-commits mailing list