From 741f21d4405dc99e32aad29ae4d76d21eaf508d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 15 Feb 2023 10:26:25 +0100 Subject: [PATCH] Resolves: #2151540 - fix memory leak when ipv6 disable set to 1 --- net-snmp-5.9-ipv6-disable-leak.patch | 12 ++++++++++++ net-snmp.spec | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9-ipv6-disable-leak.patch diff --git a/net-snmp-5.9-ipv6-disable-leak.patch b/net-snmp-5.9-ipv6-disable-leak.patch new file mode 100644 index 0000000..f8c20fd --- /dev/null +++ b/net-snmp-5.9-ipv6-disable-leak.patch @@ -0,0 +1,12 @@ +diff -urNp a/snmplib/snmp_logging.c b/snmplib/snmp_logging.c +--- a/snmplib/snmp_logging.c 2023-02-15 10:19:15.691827254 +0100 ++++ b/snmplib/snmp_logging.c 2023-02-15 10:24:41.006642974 +0100 +@@ -490,7 +490,7 @@ snmp_log_options(char *optarg, int argc, + char * + snmp_log_syslogname(const char *pstr) + { +- if (pstr) ++ if (pstr && (pstr != syslogname)) + strlcpy (syslogname, pstr, sizeof(syslogname)); + + return syslogname; diff --git a/net-snmp.spec b/net-snmp.spec index 9011e13..d7b1491 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -53,6 +53,7 @@ Patch23: net-snmp-5.9-intermediate-certs.patch Patch24: net-snmp-5.9-twice-IP-parsing.patch Patch25: net-snmp-5.9-openssl-3.0.patch Patch26: net-snmp-5.9-CVE-2022-44792-44793.patch +Patch27: net-snmp-5.9-ipv6-disable-leak.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -230,7 +231,8 @@ cp %{SOURCE10} . %patch23 -p1 -b .intermediate-certs %patch24 -p1 -b .twice-IP-parsing %patch25 -p1 -b .openssl-3-0 -%patch26 -p1 -b .CVE-2022-44792-44793 +%patch26 -p1 +%patch27 -p1 -b .ipv6-disable-leak %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -502,6 +504,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %changelog * Wed Feb 15 2023 Josef Ridky - 1:5.9.1-9 - fix CVE-2022-44792 and CVE-2022-44793 (#2141902) and (#2141906) +- fix memory leak when ipv6 disable set to 1 (#2151540) * Thu Apr 07 2022 Josef Ridky - 1:5.9.1-8 - fix default snmpd.conf file content (#2067954)