From 3d45358cc7c255e5464fbba0b5b7481ae681a1d3 Mon Sep 17 00:00:00 2001 From: Josef Ridky Date: Tue, 27 Mar 2018 10:55:06 +0200 Subject: [PATCH] Upstream iterator fix --- net-snmp-5.7.3-iterator-fix.patch | 16 ++++++++-------- net-snmp.spec | 5 ++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/net-snmp-5.7.3-iterator-fix.patch b/net-snmp-5.7.3-iterator-fix.patch index fb34caf..1505ca9 100644 --- a/net-snmp-5.7.3-iterator-fix.patch +++ b/net-snmp-5.7.3-iterator-fix.patch @@ -1,14 +1,14 @@ diff -urNp old/agent/mibgroup/host/data_access/swrun.c new/agent/mibgroup/host/data_access/swrun.c ---- old/agent/mibgroup/host/data_access/swrun.c 2017-07-18 09:44:00.626109526 +0200 -+++ new/agent/mibgroup/host/data_access/swrun.c 2017-07-19 15:27:50.452255836 +0200 -@@ -102,6 +102,10 @@ swrun_count_processes_by_name( char *nam +--- old/agent/mibgroup/host/data_access/swrun.c 2018-03-26 09:00:39.932335587 +0200 ++++ new/agent/mibgroup/host/data_access/swrun.c 2018-03-26 09:03:00.845876681 +0200 +@@ -102,7 +102,9 @@ swrun_count_processes_by_name( char *nam return 0; /* or -1 */ it = CONTAINER_ITERATOR( swrun_container ); -+ if((entry = (netsnmp_swrun_entry*)ITERATOR_FIRST( it )) != NULL) { -+ if (0 == strcmp( entry->hrSWRunName, name )) -+ i++; -+ } - while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) { +- while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) { ++ for (entry = (netsnmp_swrun_entry*)ITERATOR_FIRST( it ); ++ entry; ++ entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) { if (0 == strcmp( entry->hrSWRunName, name )) i++; + } diff --git a/net-snmp.spec b/net-snmp.spec index 45ccfa2..5bd9c58 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -7,7 +7,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.7.3 -Release: 36%{?dist} +Release: 37%{?dist} Epoch: 1 License: BSD @@ -494,6 +494,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.* %changelog +* Tue Mar 27 2018 Josef Ridky - 1:5.7.3-37 +- backport upstream patch for structure iterator + * Thu Mar 08 2018 Josef Ridky - 1:5.7.3-36 - CVE-2018-1000116 Heap corruption in snmp_pdu_parse (#1552844)