From 7212e267609f18005ec1b624653c3d109ea6c0ff Mon Sep 17 00:00:00 2001 From: Josef Ridky Date: Thu, 8 Feb 2018 12:15:50 +0100 Subject: [PATCH] Fix strstr() crash when looking for RPM Group tag --- net-snmp-5.7.3-strstr.patch | 13 +++++++++++++ net-snmp.spec | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.7.3-strstr.patch diff --git a/net-snmp-5.7.3-strstr.patch b/net-snmp-5.7.3-strstr.patch new file mode 100644 index 0000000..82c4c57 --- /dev/null +++ b/net-snmp-5.7.3-strstr.patch @@ -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 */ + + diff --git a/net-snmp.spec b/net-snmp.spec index d5ca698..dbfbe77 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -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 - 1:5.7.3-33 +- Fix strstr() crash when looking for RPM Group tag + * Thu Feb 08 2018 Fedora Release Engineering - 1:5.7.3-32 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild