From abfa1c88f66956bc6a7262e2cc27bb421f32663c Mon Sep 17 00:00:00 2001 From: fuanan <2385803914@qq.com> Date: Thu, 16 Jun 2022 19:43:41 +0800 Subject: [PATCH] Fix memory leaks for xmlACatalogAdd --- Fix-memory-leaks-for-xmlACatalogAdd.patch | 28 +++++++++++++++++++++++ libxml2.spec | 9 +++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 Fix-memory-leaks-for-xmlACatalogAdd.patch diff --git a/Fix-memory-leaks-for-xmlACatalogAdd.patch b/Fix-memory-leaks-for-xmlACatalogAdd.patch new file mode 100644 index 0000000..cbb655b --- /dev/null +++ b/Fix-memory-leaks-for-xmlACatalogAdd.patch @@ -0,0 +1,28 @@ +From 9736e895d02e889b25c7e8a73afe3f7bf61dca27 Mon Sep 17 00:00:00 2001 +From: xiezhipeng +Date: Thu, 16 Jun 2022 19:13:10 +0800 +Subject: [PATCH] Fix memory leaks for xmlACatalogAdd + +--- + xmlcatalog.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xmlcatalog.c b/xmlcatalog.c +index 3f0e1b9..6fdbff9 100644 +--- a/xmlcatalog.c ++++ b/xmlcatalog.c +@@ -527,6 +527,11 @@ int main(int argc, char **argv) { + xmlACatalogDump(catal, stdout); + } + i += 2; ++ /* Check for memory leaks */ ++ if (catal != NULL) ++ xmlFreeCatalog(catal); ++ if (super != NULL) ++ xmlFreeCatalog(super); + } else { + if ((!strcmp(argv[i], "-add")) || + (!strcmp(argv[i], "--add"))) { +-- +1.8.3.1 + diff --git a/libxml2.spec b/libxml2.spec index 225adf0..95bb9a0 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,7 +1,7 @@ Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.12 -Release: 6 +Release: 7 License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz @@ -18,6 +18,7 @@ Patch8: Patch-to-forbid-epsilon-reduction-of-final-states.patch Patch9: Fix-buffering-in-xmlOutputBufferWrite.patch Patch10:backport-CVE-2022-23308-Use-after-free-of-ID-and-IDREF-attrib.patch Patch11:backport-CVE-2022-29824-Fix-integer-overflows-in-xmlBuf-and-xmlBuffer.patch +Patch12:Fix-memory-leaks-for-xmlACatalogAdd.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python3-devel @@ -178,6 +179,12 @@ rm -fr %{buildroot} %changelog +* Thu Jun 16 2022 fuanan - 2.9.12-7 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:Fix memory leaks for xmlACatalogAdd + * Mon May 09 2022 fuanan - 2.9.12-6 - Type:CVE - ID:CVE-2022-29824 -- Gitee