1 |
commit: 2b4cd933be0aa6b6e224415e17a22c9ea4b49a81 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 3 14:39:57 2018 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 3 14:50:34 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b4cd933 |
7 |
|
8 |
media-libs/raptor: Fix heap overflows, gtk-doc location, EAPI-7 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/621186 |
11 |
Closes: https://bugs.gentoo.org/604290 |
12 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
13 |
Package-Manager: Portage-2.3.50, Repoman-2.3.11 |
14 |
|
15 |
.../raptor/files/raptor-2.0.15-heap-overflow.patch | 42 +++++++++++++ |
16 |
media-libs/raptor/raptor-2.0.15-r1.ebuild | 71 ++++++++++++++++++++++ |
17 |
2 files changed, 113 insertions(+) |
18 |
|
19 |
diff --git a/media-libs/raptor/files/raptor-2.0.15-heap-overflow.patch b/media-libs/raptor/files/raptor-2.0.15-heap-overflow.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..3418d4bfd26 |
22 |
--- /dev/null |
23 |
+++ b/media-libs/raptor/files/raptor-2.0.15-heap-overflow.patch |
24 |
@@ -0,0 +1,42 @@ |
25 |
+From 590681e546cd9aa18d57dc2ea1858cb734a3863f Mon Sep 17 00:00:00 2001 |
26 |
+From: Dave Beckett <dave@××××××.org> |
27 |
+Date: Sun, 16 Apr 2017 23:15:12 +0100 |
28 |
+Subject: [PATCH] Calcualte max nspace declarations correctly for XML writer |
29 |
+ |
30 |
+(raptor_xml_writer_start_element_common): Calculate max including for |
31 |
+each attribute a potential name and value. |
32 |
+ |
33 |
+Fixes Issues #0000617 http://bugs.librdf.org/mantis/view.php?id=617 |
34 |
+and #0000618 http://bugs.librdf.org/mantis/view.php?id=618 |
35 |
+--- |
36 |
+ src/raptor_xml_writer.c | 7 ++++--- |
37 |
+ 1 file changed, 4 insertions(+), 3 deletions(-) |
38 |
+ |
39 |
+diff --git a/src/raptor_xml_writer.c b/src/raptor_xml_writer.c |
40 |
+index 693b946..0d3a36a 100644 |
41 |
+--- a/src/raptor_xml_writer.c |
42 |
++++ b/src/raptor_xml_writer.c |
43 |
+@@ -181,9 +181,10 @@ raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer, |
44 |
+ size_t nspace_declarations_count = 0; |
45 |
+ unsigned int i; |
46 |
+ |
47 |
+- /* max is 1 per element and 1 for each attribute + size of declared */ |
48 |
+ if(nstack) { |
49 |
+- int nspace_max_count = element->attribute_count+1; |
50 |
++ int nspace_max_count = element->attribute_count * 2; /* attr and value */ |
51 |
++ if(element->name->nspace) |
52 |
++ nspace_max_count++; |
53 |
+ if(element->declared_nspaces) |
54 |
+ nspace_max_count += raptor_sequence_size(element->declared_nspaces); |
55 |
+ if(element->xml_language) |
56 |
+@@ -237,7 +238,7 @@ raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer, |
57 |
+ } |
58 |
+ } |
59 |
+ |
60 |
+- /* Add the attribute + value */ |
61 |
++ /* Add the attribute's value */ |
62 |
+ nspace_declarations[nspace_declarations_count].declaration= |
63 |
+ raptor_qname_format_as_xml(element->attributes[i], |
64 |
+ &nspace_declarations[nspace_declarations_count].length); |
65 |
+-- |
66 |
+2.9.3 |
67 |
|
68 |
diff --git a/media-libs/raptor/raptor-2.0.15-r1.ebuild b/media-libs/raptor/raptor-2.0.15-r1.ebuild |
69 |
new file mode 100644 |
70 |
index 00000000000..55dca5e226b |
71 |
--- /dev/null |
72 |
+++ b/media-libs/raptor/raptor-2.0.15-r1.ebuild |
73 |
@@ -0,0 +1,71 @@ |
74 |
+# Copyright 1999-2018 Gentoo Authors |
75 |
+# Distributed under the terms of the GNU General Public License v2 |
76 |
+ |
77 |
+EAPI=7 |
78 |
+ |
79 |
+inherit libtool |
80 |
+ |
81 |
+MY_PN=${PN}2 |
82 |
+MY_P=${MY_PN}-${PV} |
83 |
+ |
84 |
+DESCRIPTION="The RDF Parser Toolkit" |
85 |
+HOMEPAGE="http://librdf.org/raptor/" |
86 |
+SRC_URI="http://download.librdf.org/source/${MY_P}.tar.gz" |
87 |
+ |
88 |
+LICENSE="Apache-2.0 GPL-2 LGPL-2.1" |
89 |
+SLOT="2" |
90 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
91 |
+IUSE="+curl debug json static-libs unicode" |
92 |
+ |
93 |
+DEPEND=" |
94 |
+ dev-libs/libxml2 |
95 |
+ dev-libs/libxslt |
96 |
+ curl? ( net-misc/curl ) |
97 |
+ json? ( dev-libs/yajl ) |
98 |
+ unicode? ( dev-libs/icu:= ) |
99 |
+" |
100 |
+RDEPEND="${DEPEND} |
101 |
+ !media-libs/raptor:0 |
102 |
+" |
103 |
+BDEPEND=" |
104 |
+ >=sys-devel/bison-3 |
105 |
+ >=sys-devel/flex-2.5.36 |
106 |
+ virtual/pkgconfig |
107 |
+" |
108 |
+ |
109 |
+S="${WORKDIR}/${MY_P}" |
110 |
+ |
111 |
+DOCS=( AUTHORS ChangeLog NEWS NOTICE README ) |
112 |
+HTML_DOCS=( {NEWS,README,RELEASE,UPGRADING}.html ) |
113 |
+ |
114 |
+PATCHES=( "${FILESDIR}/${P}-heap-overflow.patch" ) |
115 |
+ |
116 |
+src_prepare() { |
117 |
+ default |
118 |
+ elibtoolize # Keep this for ~*-fbsd |
119 |
+} |
120 |
+ |
121 |
+src_configure() { |
122 |
+ # FIXME: It should be possible to use net-nntp/inn for libinn.h and -linn! |
123 |
+ |
124 |
+ local myeconfargs=( |
125 |
+ --with-www=xml |
126 |
+ --with-html-dir="${EPREFIX}"/usr/share/gtk-doc/html |
127 |
+ $(use_enable debug) |
128 |
+ $(use_with json yajl) |
129 |
+ $(use_enable static-libs static) |
130 |
+ $(usex unicode "--with-icu-config="${EPREFIX}"/usr/bin/icu-config" '') |
131 |
+ ) |
132 |
+ use curl && myeconfargs+=( --with-www=curl ) |
133 |
+ |
134 |
+ econf "${myeconfargs[@]}" |
135 |
+} |
136 |
+ |
137 |
+src_test() { |
138 |
+ emake -j1 test |
139 |
+} |
140 |
+ |
141 |
+src_install() { |
142 |
+ default |
143 |
+ find "${D}" -name '*.la' -delete || die |
144 |
+} |