File net-snmp-5.4.x_counter-wrap-crash.patch of Package net-snmp
From: Marcus Ruckert
Subject: snmpd 5.3.0.1 core during high traffic
References: bnc#523553
Patch-mainline: r17714
Fix possible crash when 64-bit counters in ipSystemStatsTable get bigger
than 2^32.
Signed-off-by: Marcus Rueckert <mrueckert@suse.de>
Signed-off-by: Leonardo Chiquitto <lchiquitto@suse.de>
---
systemstats_common.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: agent/mibgroup/ip-mib/data_access/systemstats_common.c
===================================================================
--- agent/mibgroup/ip-mib/data_access/systemstats_common.c.orig
+++ agent/mibgroup/ip-mib/data_access/systemstats_common.c
@@ -421,13 +421,13 @@ netsnmp_access_systemstats_entry_update_
*/
if (0 == need_wrap_check) {
SNMP_FREE(prev_vals->old_stats);
+ } else {
+ /*
+ * update old stats from new stats.
+ * careful - old_stats is a pointer to stats...
+ */
+ memcpy(prev_vals->old_stats, &new_vals->stats, sizeof(new_vals->stats));
}
-
- /*
- * update old stats from new stats.
- * careful - old_stats is a pointer to stats...
- */
- memcpy(prev_vals->old_stats, &new_vals->stats, sizeof(new_vals->stats));
_calculate_entries(prev_vals);