* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libcroco/files/, dev-libs/libcroco/
@ 2017-05-09 22:26 Mart Raudsepp
0 siblings, 0 replies; 3+ messages in thread
From: Mart Raudsepp @ 2017-05-09 22:26 UTC (permalink / raw
To: gentoo-commits
commit: e5e2894861c46e803eebe5a6bd86f8cac9ea655f
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Tue May 9 22:15:56 2017 +0000
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Tue May 9 22:17:29 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5e28948
dev-libs/libcroco: revbump for security fixes (CVE-2017-7960, CVE-2017-7961)
Gentoo-bug: 618012
Package-Manager: Portage-2.3.5, Repoman-2.3.2
dev-libs/libcroco/files/0.6.12-CVE-2017-7960.patch | 40 +++++++++++++++
dev-libs/libcroco/files/0.6.12-CVE-2017-7961.patch | 42 +++++++++++++++
dev-libs/libcroco/libcroco-0.6.12-r1.ebuild | 59 ++++++++++++++++++++++
3 files changed, 141 insertions(+)
diff --git a/dev-libs/libcroco/files/0.6.12-CVE-2017-7960.patch b/dev-libs/libcroco/files/0.6.12-CVE-2017-7960.patch
new file mode 100644
index 00000000000..50095d50b89
--- /dev/null
+++ b/dev-libs/libcroco/files/0.6.12-CVE-2017-7960.patch
@@ -0,0 +1,40 @@
+From 898e3a8c8c0314d2e6b106809a8e3e93cf9d4394 Mon Sep 17 00:00:00 2001
+From: Ignacio Casal Quinteiro
+Date: Sun, 16 Apr 2017 13:13:43 +0200
+Subject: [PATCH 1/3] input: check end of input before reading a byte
+
+When reading bytes we weren't check that the index wasn't
+out of bound and this could produce an invalid read which
+could deal to a security bug.
+---
+leio: Snipped cosmetic chunks
+
+diff --git a/src/cr-input.c b/src/cr-input.c
+index 49000b1..3b63a88 100644
+--- a/src/cr-input.c
++++ b/src/cr-input.c
+@@ -404,6 +404,8 @@ cr_input_get_nb_bytes_left (CRInput const * a_this)
+ enum CRStatus
+ cr_input_read_byte (CRInput * a_this, guchar * a_byte)
+ {
++ gulong nb_bytes_left = 0;
++
+ g_return_val_if_fail (a_this && PRIVATE (a_this)
+ && a_byte, CR_BAD_PARAM_ERROR);
+
+@@ -413,6 +415,12 @@ cr_input_read_byte (CRInput * a_this, guchar * a_byte)
+ if (PRIVATE (a_this)->end_of_input == TRUE)
+ return CR_END_OF_INPUT_ERROR;
+
++ nb_bytes_left = cr_input_get_nb_bytes_left (a_this);
++
++ if (nb_bytes_left < 1) {
++ return CR_END_OF_INPUT_ERROR;
++ }
++
+ *a_byte = PRIVATE (a_this)->in_buf[PRIVATE (a_this)->next_byte_index];
+
+ if (PRIVATE (a_this)->nb_bytes -
+--
+2.10.1
+
diff --git a/dev-libs/libcroco/files/0.6.12-CVE-2017-7961.patch b/dev-libs/libcroco/files/0.6.12-CVE-2017-7961.patch
new file mode 100644
index 00000000000..65a08f4ebab
--- /dev/null
+++ b/dev-libs/libcroco/files/0.6.12-CVE-2017-7961.patch
@@ -0,0 +1,42 @@
+From 9ad72875e9f08e4c519ef63d44cdbd94aa9504f7 Mon Sep 17 00:00:00 2001
+From: Ignacio Casal Quinteiro <qignacio@amazon.com>
+Date: Sun, 16 Apr 2017 13:56:09 +0200
+Subject: [PATCH 3/3] tknzr: support only max long rgb values
+
+This fixes a possible out of bound when reading rgbs which
+are longer than the support MAXLONG
+---
+ src/cr-tknzr.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/cr-tknzr.c b/src/cr-tknzr.c
+index 1a7cfeb..1548c35 100644
+--- a/src/cr-tknzr.c
++++ b/src/cr-tknzr.c
+@@ -1279,6 +1279,11 @@ cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
+ status = cr_tknzr_parse_num (a_this, &num);
+ ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));
+
++ if (num->val > G_MAXLONG) {
++ status = CR_PARSING_ERROR;
++ goto error;
++ }
++
+ red = num->val;
+ cr_num_destroy (num);
+ num = NULL;
+@@ -1298,6 +1303,11 @@ cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
+ status = cr_tknzr_parse_num (a_this, &num);
+ ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));
+
++ if (num->val > G_MAXLONG) {
++ status = CR_PARSING_ERROR;
++ goto error;
++ }
++
+ PEEK_BYTE (a_this, 1, &next_bytes[0]);
+ if (next_bytes[0] == '%') {
+ SKIP_CHARS (a_this, 1);
+--
+2.10.1
+
diff --git a/dev-libs/libcroco/libcroco-0.6.12-r1.ebuild b/dev-libs/libcroco/libcroco-0.6.12-r1.ebuild
new file mode 100644
index 00000000000..4d6b093b70a
--- /dev/null
+++ b/dev-libs/libcroco/libcroco-0.6.12-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+GNOME2_LA_PUNT="yes"
+
+inherit gnome2 multilib-minimal
+
+DESCRIPTION="Generic Cascading Style Sheet (CSS) parsing and manipulation toolkit"
+HOMEPAGE="https://git.gnome.org/browse/libcroco/"
+
+LICENSE="LGPL-2"
+SLOT="0.6"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="test"
+
+RDEPEND="
+ >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}]
+ >=dev-libs/libxml2-2.9.1-r4[${MULTILIB_USEDEP}]
+"
+DEPEND="${RDEPEND}
+ dev-util/gtk-doc-am
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-CVE-2017-7960.patch
+ "${FILESDIR}"/${PV}-CVE-2017-7961.patch
+)
+
+src_prepare() {
+ if ! use test; then
+ # don't waste time building tests
+ sed 's/^\(SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' -i Makefile.am Makefile.in \
+ || die "sed failed"
+ fi
+
+ gnome2_src_prepare
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ gnome2_src_configure \
+ --disable-static \
+ $([[ ${CHOST} == *-darwin* ]] && echo --disable-Bsymbolic)
+
+ if multilib_is_native_abi; then
+ ln -s "${S}"/docs/reference/html docs/reference/html || die
+ fi
+}
+
+multilib_src_install() {
+ gnome2_src_install
+}
+
+multilib_src_install_all() {
+ DOCS="AUTHORS ChangeLog HACKING NEWS README TODO"
+ einstalldocs
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libcroco/files/, dev-libs/libcroco/
@ 2020-01-11 19:24 Mart Raudsepp
0 siblings, 0 replies; 3+ messages in thread
From: Mart Raudsepp @ 2020-01-11 19:24 UTC (permalink / raw
To: gentoo-commits
commit: 94e12aeabfce23de76fc295e93d980498c46d042
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 11 19:19:59 2020 +0000
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 19:19:59 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94e12aea
dev-libs/libcroco: remove old
Package-Manager: Portage-2.3.79, Repoman-2.3.12
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
dev-libs/libcroco/Manifest | 1 -
dev-libs/libcroco/files/0.6.12-CVE-2017-7960.patch | 40 ---------------
dev-libs/libcroco/files/0.6.12-CVE-2017-7961.patch | 42 ---------------
dev-libs/libcroco/libcroco-0.6.12-r1.ebuild | 60 ----------------------
4 files changed, 143 deletions(-)
diff --git a/dev-libs/libcroco/Manifest b/dev-libs/libcroco/Manifest
index 2329c260cf2..647d3f20e22 100644
--- a/dev-libs/libcroco/Manifest
+++ b/dev-libs/libcroco/Manifest
@@ -1,2 +1 @@
-DIST libcroco-0.6.12.tar.xz 482028 BLAKE2B d43b73ba21f600ec6d549b867a58db956e081ca8b0787db577062e36487d23cd99b384ca3269421d26aff9825725b262fd6a3e48be73448fe984548ab3eb080b SHA512 af9a171d5ccded255b57f170576e67155f12fa0f61ab3e379e907975f77afc37e82e22772c6019b2897cffc15b2425faf3ccfda92b1a45b23eda2519debabeb6
DIST libcroco-0.6.13.tar.xz 487840 BLAKE2B 511212f1849343d55104cc6d17662cacd524bae098bab12d6db58df41710c8dca2c5beb7a37e42feac6d856934a07feb3d11c55dc74ba055e21066f2bdefb260 SHA512 038a3ac9d160a8cf86a8a88c34367e154ef26ede289c93349332b7bc449a5199b51ea3611cebf3a2416ae23b9e45ecf8f9c6b24ea6d16a5519b796d3c7e272d4
diff --git a/dev-libs/libcroco/files/0.6.12-CVE-2017-7960.patch b/dev-libs/libcroco/files/0.6.12-CVE-2017-7960.patch
deleted file mode 100644
index 50095d50b89..00000000000
--- a/dev-libs/libcroco/files/0.6.12-CVE-2017-7960.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 898e3a8c8c0314d2e6b106809a8e3e93cf9d4394 Mon Sep 17 00:00:00 2001
-From: Ignacio Casal Quinteiro
-Date: Sun, 16 Apr 2017 13:13:43 +0200
-Subject: [PATCH 1/3] input: check end of input before reading a byte
-
-When reading bytes we weren't check that the index wasn't
-out of bound and this could produce an invalid read which
-could deal to a security bug.
----
-leio: Snipped cosmetic chunks
-
-diff --git a/src/cr-input.c b/src/cr-input.c
-index 49000b1..3b63a88 100644
---- a/src/cr-input.c
-+++ b/src/cr-input.c
-@@ -404,6 +404,8 @@ cr_input_get_nb_bytes_left (CRInput const * a_this)
- enum CRStatus
- cr_input_read_byte (CRInput * a_this, guchar * a_byte)
- {
-+ gulong nb_bytes_left = 0;
-+
- g_return_val_if_fail (a_this && PRIVATE (a_this)
- && a_byte, CR_BAD_PARAM_ERROR);
-
-@@ -413,6 +415,12 @@ cr_input_read_byte (CRInput * a_this, guchar * a_byte)
- if (PRIVATE (a_this)->end_of_input == TRUE)
- return CR_END_OF_INPUT_ERROR;
-
-+ nb_bytes_left = cr_input_get_nb_bytes_left (a_this);
-+
-+ if (nb_bytes_left < 1) {
-+ return CR_END_OF_INPUT_ERROR;
-+ }
-+
- *a_byte = PRIVATE (a_this)->in_buf[PRIVATE (a_this)->next_byte_index];
-
- if (PRIVATE (a_this)->nb_bytes -
---
-2.10.1
-
diff --git a/dev-libs/libcroco/files/0.6.12-CVE-2017-7961.patch b/dev-libs/libcroco/files/0.6.12-CVE-2017-7961.patch
deleted file mode 100644
index 65a08f4ebab..00000000000
--- a/dev-libs/libcroco/files/0.6.12-CVE-2017-7961.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 9ad72875e9f08e4c519ef63d44cdbd94aa9504f7 Mon Sep 17 00:00:00 2001
-From: Ignacio Casal Quinteiro <qignacio@amazon.com>
-Date: Sun, 16 Apr 2017 13:56:09 +0200
-Subject: [PATCH 3/3] tknzr: support only max long rgb values
-
-This fixes a possible out of bound when reading rgbs which
-are longer than the support MAXLONG
----
- src/cr-tknzr.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/src/cr-tknzr.c b/src/cr-tknzr.c
-index 1a7cfeb..1548c35 100644
---- a/src/cr-tknzr.c
-+++ b/src/cr-tknzr.c
-@@ -1279,6 +1279,11 @@ cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
- status = cr_tknzr_parse_num (a_this, &num);
- ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));
-
-+ if (num->val > G_MAXLONG) {
-+ status = CR_PARSING_ERROR;
-+ goto error;
-+ }
-+
- red = num->val;
- cr_num_destroy (num);
- num = NULL;
-@@ -1298,6 +1303,11 @@ cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
- status = cr_tknzr_parse_num (a_this, &num);
- ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));
-
-+ if (num->val > G_MAXLONG) {
-+ status = CR_PARSING_ERROR;
-+ goto error;
-+ }
-+
- PEEK_BYTE (a_this, 1, &next_bytes[0]);
- if (next_bytes[0] == '%') {
- SKIP_CHARS (a_this, 1);
---
-2.10.1
-
diff --git a/dev-libs/libcroco/libcroco-0.6.12-r1.ebuild b/dev-libs/libcroco/libcroco-0.6.12-r1.ebuild
deleted file mode 100644
index 9cea2f4ac75..00000000000
--- a/dev-libs/libcroco/libcroco-0.6.12-r1.ebuild
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-GNOME2_LA_PUNT="yes"
-
-inherit gnome2 multilib-minimal
-
-DESCRIPTION="Generic Cascading Style Sheet (CSS) parsing and manipulation toolkit"
-HOMEPAGE="https://git.gnome.org/browse/libcroco/"
-
-LICENSE="LGPL-2"
-SLOT="0.6"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}]
- >=dev-libs/libxml2-2.9.1-r4[${MULTILIB_USEDEP}]
-"
-DEPEND="${RDEPEND}
- dev-util/gtk-doc-am
- >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
-"
-
-PATCHES=(
- "${FILESDIR}"/${PV}-CVE-2017-7960.patch
- "${FILESDIR}"/${PV}-CVE-2017-7961.patch
-)
-
-src_prepare() {
- if ! use test; then
- # don't waste time building tests
- sed 's/^\(SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' -i Makefile.am Makefile.in \
- || die "sed failed"
- fi
-
- gnome2_src_prepare
-}
-
-multilib_src_configure() {
- ECONF_SOURCE=${S} \
- gnome2_src_configure \
- --disable-static \
- $([[ ${CHOST} == *-darwin* ]] && echo --disable-Bsymbolic)
-
- if multilib_is_native_abi; then
- ln -s "${S}"/docs/reference/html docs/reference/html || die
- fi
-}
-
-multilib_src_install() {
- gnome2_src_install
-}
-
-multilib_src_install_all() {
- DOCS="AUTHORS ChangeLog HACKING NEWS README TODO"
- einstalldocs
-}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libcroco/files/, dev-libs/libcroco/
@ 2021-05-25 21:42 Thomas Deutschmann
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Deutschmann @ 2021-05-25 21:42 UTC (permalink / raw
To: gentoo-commits
commit: 2c5ef4bf3c0497dd26da1f97b48e3a4b2e11241e
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue May 25 21:42:08 2021 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue May 25 21:42:19 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c5ef4bf
dev-libs/libcroco: fix CVE-2020-12825
Bug: https://bugs.gentoo.org/722752
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
.../files/libcroco-0.6.13-CVE-2020-12825.patch | 187 +++++++++++++++++++++
dev-libs/libcroco/libcroco-0.6.13-r1.ebuild | 57 +++++++
2 files changed, 244 insertions(+)
diff --git a/dev-libs/libcroco/files/libcroco-0.6.13-CVE-2020-12825.patch b/dev-libs/libcroco/files/libcroco-0.6.13-CVE-2020-12825.patch
new file mode 100644
index 00000000000..26fc677eb16
--- /dev/null
+++ b/dev-libs/libcroco/files/libcroco-0.6.13-CVE-2020-12825.patch
@@ -0,0 +1,187 @@
+From 44cbd1e718d6a08e59b9300280c340218a84e089 Mon Sep 17 00:00:00 2001
+From: Michael Catanzaro <mcatanzaro@gnome.org>
+Date: Wed, 12 Aug 2020 13:54:15 -0500
+Subject: [PATCH] libcroco: Limit recursion in block and any productions
+ (CVE-2020-12825)
+
+If we don't have any limits, we can recurse forever and overflow the
+stack.
+
+This is per https://gitlab.gnome.org/Archive/libcroco/-/issues/8
+
+https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1404
+---
+ src/cr-parser.c | 44 ++++++++++++++++++++++++++--------------
+ 1 file changed, 29 insertions(+), 15 deletions(-)
+
+diff --git a/src/cr-parser.c b/src/cr-parser.c
+index 07f4ed9e8b..8304b75614 100644
+--- a/src/cr-parser.c
++++ b/src/cr-parser.c
+@@ -136,6 +136,8 @@ struct _CRParserPriv {
+
+ #define CHARS_TAB_SIZE 12
+
++#define RECURSIVE_CALLERS_LIMIT 100
++
+ /**
+ * IS_NUM:
+ *@a_char: the char to test.
+@@ -343,9 +345,11 @@ static enum CRStatus cr_parser_parse_selector_core (CRParser * a_this);
+
+ static enum CRStatus cr_parser_parse_declaration_core (CRParser * a_this);
+
+-static enum CRStatus cr_parser_parse_any_core (CRParser * a_this);
++static enum CRStatus cr_parser_parse_any_core (CRParser * a_this,
++ guint n_calls);
+
+-static enum CRStatus cr_parser_parse_block_core (CRParser * a_this);
++static enum CRStatus cr_parser_parse_block_core (CRParser * a_this,
++ guint n_calls);
+
+ static enum CRStatus cr_parser_parse_value_core (CRParser * a_this);
+
+@@ -783,7 +787,7 @@ cr_parser_parse_atrule_core (CRParser * a_this)
+ cr_parser_try_to_skip_spaces_and_comments (a_this);
+
+ do {
+- status = cr_parser_parse_any_core (a_this);
++ status = cr_parser_parse_any_core (a_this, 0);
+ } while (status == CR_OK);
+
+ status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr,
+@@ -794,7 +798,7 @@ cr_parser_parse_atrule_core (CRParser * a_this)
+ cr_tknzr_unget_token (PRIVATE (a_this)->tknzr,
+ token);
+ token = NULL;
+- status = cr_parser_parse_block_core (a_this);
++ status = cr_parser_parse_block_core (a_this, 0);
+ CHECK_PARSING_STATUS (status,
+ FALSE);
+ goto done;
+@@ -929,11 +933,11 @@ cr_parser_parse_selector_core (CRParser * a_this)
+
+ RECORD_INITIAL_POS (a_this, &init_pos);
+
+- status = cr_parser_parse_any_core (a_this);
++ status = cr_parser_parse_any_core (a_this, 0);
+ CHECK_PARSING_STATUS (status, FALSE);
+
+ do {
+- status = cr_parser_parse_any_core (a_this);
++ status = cr_parser_parse_any_core (a_this, 0);
+
+ } while (status == CR_OK);
+
+@@ -955,10 +959,12 @@ cr_parser_parse_selector_core (CRParser * a_this)
+ *in chapter 4.1 of the css2 spec.
+ *block ::= '{' S* [ any | block | ATKEYWORD S* | ';' ]* '}' S*;
+ *@param a_this the current instance of #CRParser.
++ *@param n_calls used to limit recursion depth
+ *FIXME: code this function.
+ */
+ static enum CRStatus
+-cr_parser_parse_block_core (CRParser * a_this)
++cr_parser_parse_block_core (CRParser * a_this,
++ guint n_calls)
+ {
+ CRToken *token = NULL;
+ CRInputPos init_pos;
+@@ -966,6 +972,9 @@ cr_parser_parse_block_core (CRParser * a_this)
+
+ g_return_val_if_fail (a_this && PRIVATE (a_this), CR_BAD_PARAM_ERROR);
+
++ if (n_calls > RECURSIVE_CALLERS_LIMIT)
++ return CR_ERROR;
++
+ RECORD_INITIAL_POS (a_this, &init_pos);
+
+ status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr, &token);
+@@ -995,13 +1004,13 @@ cr_parser_parse_block_core (CRParser * a_this)
+ } else if (token->type == CBO_TK) {
+ cr_tknzr_unget_token (PRIVATE (a_this)->tknzr, token);
+ token = NULL;
+- status = cr_parser_parse_block_core (a_this);
++ status = cr_parser_parse_block_core (a_this, n_calls + 1);
+ CHECK_PARSING_STATUS (status, FALSE);
+ goto parse_block_content;
+ } else {
+ cr_tknzr_unget_token (PRIVATE (a_this)->tknzr, token);
+ token = NULL;
+- status = cr_parser_parse_any_core (a_this);
++ status = cr_parser_parse_any_core (a_this, n_calls + 1);
+ CHECK_PARSING_STATUS (status, FALSE);
+ goto parse_block_content;
+ }
+@@ -1108,7 +1117,7 @@ cr_parser_parse_value_core (CRParser * a_this)
+ status = cr_tknzr_unget_token (PRIVATE (a_this)->tknzr,
+ token);
+ token = NULL;
+- status = cr_parser_parse_block_core (a_this);
++ status = cr_parser_parse_block_core (a_this, 0);
+ CHECK_PARSING_STATUS (status, FALSE);
+ ref++;
+ goto continue_parsing;
+@@ -1122,7 +1131,7 @@ cr_parser_parse_value_core (CRParser * a_this)
+ status = cr_tknzr_unget_token (PRIVATE (a_this)->tknzr,
+ token);
+ token = NULL;
+- status = cr_parser_parse_any_core (a_this);
++ status = cr_parser_parse_any_core (a_this, 0);
+ if (status == CR_OK) {
+ ref++;
+ goto continue_parsing;
+@@ -1161,10 +1170,12 @@ cr_parser_parse_value_core (CRParser * a_this)
+ * | FUNCTION | DASHMATCH | '(' any* ')' | '[' any* ']' ] S*;
+ *
+ *@param a_this the current instance of #CRParser.
++ *@param n_calls used to limit recursion depth
+ *@return CR_OK upon successfull completion, an error code otherwise.
+ */
+ static enum CRStatus
+-cr_parser_parse_any_core (CRParser * a_this)
++cr_parser_parse_any_core (CRParser * a_this,
++ guint n_calls)
+ {
+ CRToken *token1 = NULL,
+ *token2 = NULL;
+@@ -1173,6 +1184,9 @@ cr_parser_parse_any_core (CRParser * a_this)
+
+ g_return_val_if_fail (a_this, CR_BAD_PARAM_ERROR);
+
++ if (n_calls > RECURSIVE_CALLERS_LIMIT)
++ return CR_ERROR;
++
+ RECORD_INITIAL_POS (a_this, &init_pos);
+
+ status = cr_tknzr_get_next_token (PRIVATE (a_this)->tknzr, &token1);
+@@ -1211,7 +1225,7 @@ cr_parser_parse_any_core (CRParser * a_this)
+ *We consider parameter as being an "any*" production.
+ */
+ do {
+- status = cr_parser_parse_any_core (a_this);
++ status = cr_parser_parse_any_core (a_this, n_calls + 1);
+ } while (status == CR_OK);
+
+ ENSURE_PARSING_COND (status == CR_PARSING_ERROR);
+@@ -1236,7 +1250,7 @@ cr_parser_parse_any_core (CRParser * a_this)
+ }
+
+ do {
+- status = cr_parser_parse_any_core (a_this);
++ status = cr_parser_parse_any_core (a_this, n_calls + 1);
+ } while (status == CR_OK);
+
+ ENSURE_PARSING_COND (status == CR_PARSING_ERROR);
+@@ -1264,7 +1278,7 @@ cr_parser_parse_any_core (CRParser * a_this)
+ }
+
+ do {
+- status = cr_parser_parse_any_core (a_this);
++ status = cr_parser_parse_any_core (a_this, n_calls + 1);
+ } while (status == CR_OK);
+
+ ENSURE_PARSING_COND (status == CR_PARSING_ERROR);
+--
+GitLab
+
diff --git a/dev-libs/libcroco/libcroco-0.6.13-r1.ebuild b/dev-libs/libcroco/libcroco-0.6.13-r1.ebuild
new file mode 100644
index 00000000000..8e6f4779040
--- /dev/null
+++ b/dev-libs/libcroco/libcroco-0.6.13-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit gnome2 multilib-minimal
+
+DESCRIPTION="Generic Cascading Style Sheet (CSS) parsing and manipulation toolkit"
+HOMEPAGE="https://gitlab.gnome.org/Archive/libcroco"
+
+LICENSE="LGPL-2"
+SLOT="0.6"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}]
+ >=dev-libs/libxml2-2.9.1-r4[${MULTILIB_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ dev-util/gtk-doc-am
+ virtual/pkgconfig
+"
+
+PATCHES=( "${FILESDIR}"/${PN}-0.6.13-CVE-2020-12825.patch )
+
+src_prepare() {
+ if ! use test; then
+ # don't waste time building tests
+ sed 's/^\(SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' -i Makefile.am Makefile.in \
+ || die "sed failed"
+ fi
+
+ gnome2_src_prepare
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ gnome2_src_configure \
+ --disable-static \
+ $([[ ${CHOST} == *-darwin* ]] && echo --disable-Bsymbolic)
+
+ if multilib_is_native_abi; then
+ ln -s "${S}"/docs/reference/html docs/reference/html || die
+ fi
+}
+
+multilib_src_install() {
+ gnome2_src_install
+}
+
+multilib_src_install_all() {
+ DOCS=( AUTHORS ChangeLog HACKING NEWS README TODO )
+ einstalldocs
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-25 21:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-25 21:42 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libcroco/files/, dev-libs/libcroco/ Thomas Deutschmann
-- strict thread matches above, loose matches on Subject: below --
2020-01-11 19:24 Mart Raudsepp
2017-05-09 22:26 Mart Raudsepp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox