From 7d42827878616a9567037f466551e6f9beb877f7 Mon Sep 17 00:00:00 2001 From: huangduirong Date: Sat, 30 Oct 2021 16:20:21 +0800 Subject: [PATCH] fix null deref in xmlSchemaGetComponentTargetNs --- ...ref-in-xmlSchemaGetComponentTargetNs.patch | 36 +++++++++++++++++++ libxml2.spec | 9 ++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Fix-Null-deref-in-xmlSchemaGetComponentTargetNs.patch diff --git a/Fix-Null-deref-in-xmlSchemaGetComponentTargetNs.patch b/Fix-Null-deref-in-xmlSchemaGetComponentTargetNs.patch new file mode 100644 index 0000000..8e05927 --- /dev/null +++ b/Fix-Null-deref-in-xmlSchemaGetComponentTargetNs.patch @@ -0,0 +1,36 @@ +From c3ae53279a37369d8b100b016126136dea05b44b Mon Sep 17 00:00:00 2001 +From: huangduirong +Date: Sat, 30 Oct 2021 15:21:01 +0800 +Subject: [PATCH] fix null-deref in xmlSchemaGetComponentTargetNs + +--- + xmlschemas.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/xmlschemas.c b/xmlschemas.c +index 5387c8e..17aa6df 100644 +--- a/xmlschemas.c ++++ b/xmlschemas.c +@@ -1329,6 +1329,9 @@ xmlSchemaFormatQNameNs(xmlChar **buf, xmlNsPtr ns, const xmlChar *localName) + static const xmlChar * + xmlSchemaGetComponentName(xmlSchemaBasicItemPtr item) + { ++ if (item == NULL) { ++ return (NULL); ++ } + switch (item->type) { + case XML_SCHEMA_TYPE_ELEMENT: + return (((xmlSchemaElementPtr) item)->name); +@@ -1384,6 +1387,9 @@ xmlSchemaGetQNameRefTargetNs(void *ref) + static const xmlChar * + xmlSchemaGetComponentTargetNs(xmlSchemaBasicItemPtr item) + { ++ if (item == NULL) { ++ return (NULL); ++ } + switch (item->type) { + case XML_SCHEMA_TYPE_ELEMENT: + return (((xmlSchemaElementPtr) item)->targetNamespace); +-- +1.8.3.1 + diff --git a/libxml2.spec b/libxml2.spec index 79bcfee..1996fa4 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,7 +1,7 @@ Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.10 -Release: 17 +Release: 18 License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz @@ -100,6 +100,7 @@ Patch87: Fix-null-pointer-deref-in-xmlXPtrRangeInsideFunction.patch Patch88: Stop-using-maxParserDepth-in-xpath.c.patch Patch89: Hardcode-maximum-XPath-recursion-depth.patch Patch90: Fix-XPath-recursion-limit.patch +Patch91: Fix-Null-deref-in-xmlSchemaGetComponentTargetNs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python3-devel @@ -260,6 +261,12 @@ rm -fr %{buildroot} %changelog +* Sat Oct 30 2021 huangduirong - 2.9.10-18 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix fuzz issues, fix null-deref in xmlSchemaGetComponentTargetNs + * Sat Oct 23 2021 panxiaohe - 2.9.10-17 - Type:bugfix - ID:NA -- Gitee