aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan P. Stanić <mps@arvanta.net>2019-02-25 13:53:45 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2019-02-25 15:30:54 +0100
commit36fadf98ee839df30f4c331ab9168182f5bf59fd (patch)
treea7dc351eee89b859aaefe6f12533c7b6c266d3cf
parent5dc3f744de00ce60ba421c3db7eaaaa143045446 (diff)
downloadaports-36fadf98ee839df30f4c331ab9168182f5bf59fd.tar.gz
aports-36fadf98ee839df30f4c331ab9168182f5bf59fd.tar.bz2
aports-36fadf98ee839df30f4c331ab9168182f5bf59fd.tar.xz
main/libxml2: fix null pointer dereference
fixes #10034 bump pkgrel (cherry picked from commit 70b3b18877a66cddb26ca51dbae977e677696811)
-rw-r--r--main/libxml2/APKBUILD6
-rw-r--r--main/libxml2/fix-null-pointer-dereference.patch36
2 files changed, 40 insertions, 2 deletions
diff --git a/main/libxml2/APKBUILD b/main/libxml2/APKBUILD
index 120fab4118..fa7361a4e0 100644
--- a/main/libxml2/APKBUILD
+++ b/main/libxml2/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=libxml2
pkgver=2.9.9
-pkgrel=0
+pkgrel=1
pkgdesc="XML parsing library, version 2"
url="http://www.xmlsoft.org/"
arch="all"
@@ -14,6 +14,7 @@ subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-utils
py-$pkgname:_py py2-$pkgname:_py py3-$pkgname:_py"
options="!strip"
source="http://xmlsoft.org/sources/$pkgname-$pkgver.tar.gz
+ fix-null-pointer-dereference.patch
"
builddir="$srcdir/$pkgname-$pkgver"
@@ -108,4 +109,5 @@ utils() {
mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}
-sha512sums="cb7784ba4e72e942614e12e4f83f4ceb275f3d738b30e3b5c1f25edf8e9fa6789e854685974eed95b362049dbf6c8e7357e0327d64c681ed390534ac154e6810 libxml2-2.9.9.tar.gz"
+sha512sums="cb7784ba4e72e942614e12e4f83f4ceb275f3d738b30e3b5c1f25edf8e9fa6789e854685974eed95b362049dbf6c8e7357e0327d64c681ed390534ac154e6810 libxml2-2.9.9.tar.gz
+83074e582cdba8bedff40fc653731ad18ca357bde8f1420e2e8a2a38998b951aebcb73ca5d51859be3b4d9bc1a0308836ca2bb612269edbc61b9dd6ebc7fdb2a fix-null-pointer-dereference.patch"
diff --git a/main/libxml2/fix-null-pointer-dereference.patch b/main/libxml2/fix-null-pointer-dereference.patch
new file mode 100644
index 0000000000..64e7c58f17
--- /dev/null
+++ b/main/libxml2/fix-null-pointer-dereference.patch
@@ -0,0 +1,36 @@
+From 2c8dc7158a3b7b028454abcb6f162c4da28ed80b Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Mon, 25 Feb 2019 12:00:50 +0100
+Subject: [PATCH] Fix null pointer dereference in xmlTextReaderReadOuterXml
+
+Fix a regression caused by commit 39fbfb4f. If xmlTextReaderReadOuterXml
+is called on a pristine xmlReader, the current node is NULL and must not
+be dereferenced. Move the call to xmlTextReaderExpand to the start of
+the function to make sure that we have a valid node.
+
+Fixes #43.
+---
+ xmlreader.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/xmlreader.c b/xmlreader.c
+index cd1fb5fe..b8e98287 100644
+--- a/xmlreader.c
++++ b/xmlreader.c
+@@ -1759,11 +1759,11 @@ xmlTextReaderReadOuterXml(xmlTextReaderPtr reader ATTRIBUTE_UNUSED)
+ xmlBufferPtr buff;
+ xmlDocPtr doc;
+
+- node = reader->node;
+- doc = node->doc;
+ if (xmlTextReaderExpand(reader) == NULL) {
+ return NULL;
+ }
++ node = reader->node;
++ doc = node->doc;
+ /* XXX: Why is the node copied? */
+ if (node->type == XML_DTD_NODE) {
+ node = (xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node);
+--
+2.18.1
+