Fix strstr() crash when looking for RPM Group tag

This commit is contained in:
Josef Ridky 2018-02-08 12:15:50 +01:00
parent 16f1271cc2
commit 7212e26760
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff -urNp old/agent/mibgroup/host/data_access/swinst_rpm.c new/agent/mibgroup/host/data_access/swinst_rpm.c
--- old/agent/mibgroup/host/data_access/swinst_rpm.c 2012-10-10 00:28:58.000000000 +0200
+++ new/agent/mibgroup/host/data_access/swinst_rpm.c 2017-03-23 13:39:44.695386498 +0100
@@ -129,7 +129,7 @@ netsnmp_swinst_arch_load( netsnmp_contai
"%s-%s-%s", n, v, r);
if (entry->swName_len > sizeof(entry->swName))
entry->swName_len = sizeof(entry->swName);
- entry->swType = (NULL != strstr( g, "System Environment"))
+ entry->swType = (g != NULL && NULL != strstr( g, "System Environment"))
? 2 /* operatingSystem */
: 4; /* application */

View File

@ -9,7 +9,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: 5.7.3
Release: 32%{?dist}
Release: 33%{?dist}
Epoch: 1
License: BSD
@ -59,6 +59,7 @@ Patch17: net-snmp-5.7.3-mariadb102.patch
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
# This patch fix issue with new OpenSLL library in rawhide (f26+)
# !!!WARNING!!! DO NOT USE IT FOR OLDER FEDORA RELEASES (>f26)
@ -485,6 +486,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test
%{_libdir}/libnetsnmptrapd*.so.*
%changelog
* Thu Feb 08 2018 Josef Ridky <jridky@redhat.com> - 1:5.7.3-33
- Fix strstr() crash when looking for RPM Group tag
* 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