Fix wrong usage of structure iterator

This commit is contained in:
Josef Ridky 2018-02-08 12:20:22 +01:00
parent 7212e26760
commit 080b7fe91d
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +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
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) {
if (0 == strcmp( entry->hrSWRunName, name ))
i++;

View File

@ -60,6 +60,7 @@ Patch18: 0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch
Patch19: net-snmp-5.7.3-mariadb-connector-c.patch
Patch20: net-snmp-5.7.3-strstr.patch
Patch21: net-snmp-5.7.3-iterator-fix.patch
# This patch fix issue with new OpenSLL library in rawhide (f26+)
# !!!WARNING!!! DO NOT USE IT FOR OLDER FEDORA RELEASES (>f26)
@ -219,6 +220,8 @@ cp %{SOURCE10} .
%patch17 -p1 -b .mariadb102
%patch18 -p1 -b .perlfix
%patch19 -p1 -b .mariadb-connector-c
%patch20 -p1 -b .strstr
%patch21 -p1 -b .iterator-fix
%patch100 -p1 -b .openssl
%patch101 -p1 -b .modern-rpm-api
@ -488,6 +491,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test
%changelog
* Thu Feb 08 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-33
- Fix strstr() crash when looking for RPM Group tag
- Fix wrong usage of structure iterator
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.7.3-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild