Upstream iterator fix

This commit is contained in:
Josef Ridky 2018-03-27 10:55:06 +02:00
parent a99b865945
commit 3d45358cc7
2 changed files with 12 additions and 9 deletions

View File

@ -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++;
}

View File

@ -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 <jridky@redhat.com> - 1:5.7.3-37
- backport upstream patch for structure iterator
* Thu Mar 08 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-36
- CVE-2018-1000116 Heap corruption in snmp_pdu_parse (#1552844)