commit: 80477cd34022ecaa5c67c674827a8b809dc82c51 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Mon Jun 30 04:26:14 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Mon Jun 30 04:31:01 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80477cd3
media-libs/fontconfig: fix crash on some fonts Closes: https://bugs.gentoo.org/959277 Signed-off-by: Sam James <sam <AT> gentoo.org> .../fontconfig/files/fontconfig-2.17.0-crash.patch | 32 ++++++++++++++++++++++ ...g-2.17.0.ebuild => fontconfig-2.17.0-r1.ebuild} | 1 + 2 files changed, 33 insertions(+) diff --git a/media-libs/fontconfig/files/fontconfig-2.17.0-crash.patch b/media-libs/fontconfig/files/fontconfig-2.17.0-crash.patch new file mode 100644 index 000000000000..4e861a7f4ec1 --- /dev/null +++ b/media-libs/fontconfig/files/fontconfig-2.17.0-crash.patch @@ -0,0 +1,32 @@ +https://bugs.gentoo.org/959277 +https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/481 +https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/446 +https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/b9bec06d73340f1b5727302d13ac3df307b7febc + +From b9bec06d73340f1b5727302d13ac3df307b7febc Mon Sep 17 00:00:00 2001 +From: Akira TAGOH <[email protected]> +Date: Mon, 30 Jun 2025 09:05:18 +0900 +Subject: [PATCH] Fix a heap buffer overflow + +https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/481 + +Changelog: fixed +--- + src/fcfreetype.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/fcfreetype.c b/src/fcfreetype.c +index 7a4d9811..0a87d27a 100644 +--- a/src/fcfreetype.c ++++ b/src/fcfreetype.c +@@ -2661,7 +2661,7 @@ FcFontCapabilities (FT_Face face) + goto bail; + + maxsize = (((FT_ULong)gpos_count + (FT_ULong)gsub_count) * OTLAYOUT_LEN + +- (issilgraphitefont ? strlen(fcSilfCapability) : 0)); ++ (issilgraphitefont ? strlen(fcSilfCapability) + 1: 0)); + complex_ = malloc (sizeof (FcChar8) * maxsize); + if (!complex_) + goto bail; +-- +GitLab diff --git a/media-libs/fontconfig/fontconfig-2.17.0.ebuild b/media-libs/fontconfig/fontconfig-2.17.0-r1.ebuild similarity index 99% rename from media-libs/fontconfig/fontconfig-2.17.0.ebuild rename to media-libs/fontconfig/fontconfig-2.17.0-r1.ebuild index 1006c9beb50c..daac91dbee95 100644 --- a/media-libs/fontconfig/fontconfig-2.17.0.ebuild +++ b/media-libs/fontconfig/fontconfig-2.17.0-r1.ebuild @@ -72,6 +72,7 @@ PATCHES=( # Patches from upstream (can usually be removed with next version bump) "${FILESDIR}"/${PN}-2.17.0-macro-preprocess.patch + "${FILESDIR}"/${PN}-2.17.0-crash.patch ) DOC_CONTENTS="Please make fontconfig configuration changes using
