rpms/net-snmp/F-11 net-snmp-5.4.2.1-proc-div0.patch, NONE, 1.1 net-snmp.spec, 1.179, 1.180

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


Author: jsafrane

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

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-11/net-snmp.spec,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -p -r1.179 -r1.180
--- net-snmp.spec	6 Mar 2009 22:52:04 -0000	1.179
+++ net-snmp.spec	18 May 2009 10:35:17 -0000	1.180
@@ -8,7 +8,7 @@
 Summary: A collection of SNMP protocol tools and libraries
 Name: net-snmp
 Version: %{major_ver}
-Release: 10%{?dist}
+Release: 11%{?dist}
 Epoch: 1
 
 License: BSD and MIT
@@ -35,6 +35,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
@@ -173,6 +174,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
@@ -421,6 +423,9 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_datadir}/snmp/mibs
 
 %changelog
+* Mon May 18 2009 Jan Safranek <jsafranek at redhat.com> 5.4.2.1-11
+- fix divison-by-zero in cpu statistics (#501210)
+
 * Fri Mar 06 2009 Jesse Keating <jkeating at redhat.com> - 5.4.2.1-10
 - Rebuild for new rpm
 




More information about the fedora-extras-commits mailing list