From ae0ea27abab4c4a38c2839bda9d2ec48654e34e4 Mon Sep 17 00:00:00 2001 From: Rmys Date: Thu, 26 Jul 2018 01:55:27 +0300 Subject: [PATCH] itstool:rebuild gtk-doc --- .../files/itstool-2.0.4-segfault-1.patch | 55 +++++++++++++++++++ office/docbook/itstool/pspec.xml | 5 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 office/docbook/itstool/files/itstool-2.0.4-segfault-1.patch diff --git a/office/docbook/itstool/files/itstool-2.0.4-segfault-1.patch b/office/docbook/itstool/files/itstool-2.0.4-segfault-1.patch new file mode 100644 index 0000000000..05e21cb77a --- /dev/null +++ b/office/docbook/itstool/files/itstool-2.0.4-segfault-1.patch @@ -0,0 +1,55 @@ +Submitted by: DJ Lucas (dj_AT_linuxfromscratch_DOT_org) +Date: 2017-10-26 +Initial Package Version: 2.0.4 +Upstream Status: Comitted +Origin: https://github.com/itstool/itstool/commit/9b84c007a73e8275ca45762f1bfa3ab7c3a852e2 +Description: Fixes memory exhaustion when freeing XML docs. + + +diff -Naur a/itstool.in b/itstool.in +--- a/itstool.in ++++ a/itstool.in +@@ -477,6 +477,7 @@ class Document (object): + if load_dtd: + ctxt.loadSubset(1) + if keep_entities: ++ ctxt.loadSubset(1) + ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD) + ctxt.replaceEntities(0) + else: +@@ -1043,6 +1044,7 @@ class Document (object): + if self._load_dtd: + ctxt.loadSubset(1) + if self._keep_entities: ++ ctxt.loadSubset(1) + ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD) + ctxt.replaceEntities(0) + else: +@@ -1069,7 +1071,9 @@ class Document (object): + ph_node = msg.get_placeholder(child.name).node + if self.has_child_elements(ph_node): + self.merge_translations(translations, None, ph_node, strict=strict) +- child.replaceNode(ph_node) ++ newnode = ph_node.copyNode(1) ++ newnode.setTreeDoc(self._doc) ++ child.replaceNode(newnode) + else: + repl = self.get_translated(ph_node, translations, strict=strict, lang=lang) + child.replaceNode(repl) +@@ -1084,10 +1088,15 @@ class Document (object): + (lang + ' ') if lang is not None else '', + msgstr.encode('utf-8'))) + self._xml_err = '' ++ ctxt.doc().freeDoc() + return node + retnode = node.copyNode(2) ++ retnode.setTreeDoc(self._doc) + for child in xml_child_iter(trnode): +- retnode.addChild(child.copyNode(1)) ++ newnode = child.copyNode(1) ++ newnode.setTreeDoc(self._doc) ++ retnode.addChild(newnode) ++ + ctxt.doc().freeDoc() + return retnode + diff --git a/office/docbook/itstool/pspec.xml b/office/docbook/itstool/pspec.xml index d70a39f508..98353f1e81 100644 --- a/office/docbook/itstool/pspec.xml +++ b/office/docbook/itstool/pspec.xml @@ -13,6 +13,9 @@ XML to PO and back again http://files.itstool.org/itstool/itstool-2.0.4.tar.bz2 + + itstool-2.0.4-segfault-1.patch + @@ -26,7 +29,7 @@ 2018-07-25 2.0.4 - Rebuild. + Rebuild Pisi Linux Community admin@pisilinux.org