summaryrefslogtreecommitdiff
path: root/dev-ruby/tidy-ext
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-ruby/tidy-ext
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-ruby/tidy-ext')
-rw-r--r--dev-ruby/tidy-ext/Manifest4
-rw-r--r--dev-ruby/tidy-ext/files/11CVE-2015-5522.patch34
-rw-r--r--dev-ruby/tidy-ext/metadata.xml11
-rw-r--r--dev-ruby/tidy-ext/tidy-ext-0.1.14-r3.ebuild40
4 files changed, 89 insertions, 0 deletions
diff --git a/dev-ruby/tidy-ext/Manifest b/dev-ruby/tidy-ext/Manifest
new file mode 100644
index 000000000000..30260d771bbf
--- /dev/null
+++ b/dev-ruby/tidy-ext/Manifest
@@ -0,0 +1,4 @@
+AUX 11CVE-2015-5522.patch 1397 BLAKE2B 4e14c9f6c4d18e930b9d9324ed69717980a491e2ee217b96085d570541d5622a8120a5f47d53310cdf36b8907b610f527e1acf53918289eaf8b50b121c0ee823 SHA512 d0ff033d757ab6b1b4d4d77d4429f8e39ef7e818f35a9d6edeaf7e031c6e45d9df33d318d724a66fbc0a7cecd3303c4fe5260e5b3dcda5983e732b33aa675bd8
+DIST tidy-ext-0.1.14.gem 260608 BLAKE2B 5401ec2019f25307f4083f3a1717cd2b0419e0025875b0ad461c72e50445f9b1ffc488a723db04432d262cf2dd94fd267f5261b33eb53d829f4a03d5cd29ab30 SHA512 8a8eada3cb5e815338de49332a24c85b9b2cabba0e10f2d72fe85bd4faf76924e52d82066e7b73e62bc459631aaa9d1c42a6941988ae2a71ca0ddd4f3302ad86
+EBUILD tidy-ext-0.1.14-r3.ebuild 926 BLAKE2B 82c34639c9adfc13669624084752eabf3154b05bf61f27a414c4006f50a94d13bd0af2121b22f8e2464094e506072e1514a7bddc1310165287595050424197a6 SHA512 fe306b12a152313d24a5e21d5d84f0fae065cd96a550a7725f5916e233b5d4f8007c20e89d2fbf7d323a79b82f42a7b3acb2294d1cb9ebb52508ec92bc85f771
+MISC metadata.xml 336 BLAKE2B a2b7ab053b6c4de61a2e6e7a9dda305da109a9ec7141831a0cbfdf94c627169d6d3b00a37cf171bae637b1d2799144a1f84149b9ed06cb93b0b6a8d8260cdb94 SHA512 926327c8ac77dc9d24469cee2c16b5aaea0d056db02983a53a8b7624da76edf4be443ec2ef590971de667c770347e5e4258f9eb13d0df84ae4311ea2f5d4b711
diff --git a/dev-ruby/tidy-ext/files/11CVE-2015-5522.patch b/dev-ruby/tidy-ext/files/11CVE-2015-5522.patch
new file mode 100644
index 000000000000..942209873be0
--- /dev/null
+++ b/dev-ruby/tidy-ext/files/11CVE-2015-5522.patch
@@ -0,0 +1,34 @@
+From c18f27a58792f7fbd0b30a0ff50d6b40a82f940d Mon Sep 17 00:00:00 2001
+From: Geoff McLane <ubuntu@geoffair.info>
+Date: Wed, 3 Jun 2015 20:26:03 +0200
+Subject: [PATCH] Issue #217 - avoid len going negative, ever...
+
+---
+ src/lexer.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/lexer.c b/src/lexer.c
+index 376a3d8..664f806 100644
+--- a/ext/tidy/lexer.c
++++ b/ext/tidy/lexer.c
+@@ -3739,16 +3740,17 @@ static tmbstr ParseValue( TidyDocImpl* doc, ctmbstr name,
+ /* and prompts attributes unless --literal-attributes is set to yes */
+ /* #994841 - Whitespace is removed from value attributes */
+
+- if (munge &&
++ /* Issue #217 - Also only if/while (len > 0) - MUST NEVER GO NEGATIVE! */
++ if ((len > 0) && munge &&
+ TY_(tmbstrcasecmp)(name, "alt") &&
+ TY_(tmbstrcasecmp)(name, "title") &&
+ TY_(tmbstrcasecmp)(name, "value") &&
+ TY_(tmbstrcasecmp)(name, "prompt"))
+ {
+- while (TY_(IsWhite)(lexer->lexbuf[start+len-1]))
++ while (TY_(IsWhite)(lexer->lexbuf[start+len-1]) && (len > 0))
+ --len;
+
+- while (TY_(IsWhite)(lexer->lexbuf[start]) && start < len)
++ while (TY_(IsWhite)(lexer->lexbuf[start]) && (start < len) && (len > 0))
+ {
+ ++start;
+ --len;
diff --git a/dev-ruby/tidy-ext/metadata.xml b/dev-ruby/tidy-ext/metadata.xml
new file mode 100644
index 000000000000..03567b9d3360
--- /dev/null
+++ b/dev-ruby/tidy-ext/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>ruby@gentoo.org</email>
+ <name>Gentoo Ruby Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">carld/tidy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-ruby/tidy-ext/tidy-ext-0.1.14-r3.ebuild b/dev-ruby/tidy-ext/tidy-ext-0.1.14-r3.ebuild
new file mode 100644
index 000000000000..1482a047a475
--- /dev/null
+++ b/dev-ruby/tidy-ext/tidy-ext-0.1.14-r3.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+USE_RUBY="ruby22 ruby23 ruby24 ruby25"
+
+RUBY_FAKEGEM_DOCDIR="rdoc"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec"
+
+inherit ruby-fakegem eutils
+
+DESCRIPTION="W3C HTML Tidy library implemented as a Ruby extension"
+HOMEPAGE="https://github.com/carld/tidy"
+
+LICENSE="HTML-Tidy"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ppc ppc64 ~sparc x86"
+IUSE=""
+
+RUBY_PATCHES=( 11CVE-2015-5522.patch )
+
+all_ruby_prepare() {
+ mkdir lib || die
+
+ # Remove reference to rspec 1
+ sed -i -e '/spec/d' spec/spec_helper.rb || die
+
+ # Avoid spec that needs network connectivity.
+ rm spec/tidy/remote_uri_spec.rb || die
+}
+
+each_ruby_configure() {
+ ${RUBY} -Cext/tidy extconf.rb || die "Unable to configure extension."
+}
+
+each_ruby_compile() {
+ emake -Cext/tidy V=1
+ cp ext/tidy/tidy$(get_modname) lib/ || die "Unable to copy extension."
+}