Skip to content

fix: fix crash when fontconfig fallback pattern has no charset - #68

Merged
lzwind merged 1 commit into
deepin-community:masterfrom
add-uos:emoji-porting
Sep 28, 2026
Merged

lzwind merged 1 commit into
deepin-community:masterfrom
add-uos:emoji-porting

Conversation

@add-uos

@add-uos add-uos commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter() passed the address of an uninitialized FcCharSet* to FcPatternGetCharSet() and then called FcCharSetHasChar() on it without checking the result. A pattern returned by FcFontMatch() is not guaranteed to carry an FC_CHARSET element: fontconfig treats the charset as optional, and caches produced by other fontconfig builds (e.g. a bundled snapshot that indexed .woff/.woff2 files it could not parse as empty patterns) can legally serve charset-less patterns. In that case the uninitialized pointer is dereferenced inside FcCharSetHasChar() and the process crashes with SIGSEGV; builds hardened with
-ftrivial-auto-var-init=pattern crash deterministically at 0xfefe...

log: fix crash when fontconfig fallback pattern has no charset

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

Hi @add-uos. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@github-actions

Copy link
Copy Markdown

TAG Bot

TAG: 6.8.0+dfsg-0deepin37
EXISTED: no
DISTRIBUTION: unstable

QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter() passed
the address of an uninitialized FcCharSet* to FcPatternGetCharSet()
and then called FcCharSetHasChar() on it without checking the result.
A pattern returned by FcFontMatch() is not guaranteed to carry an
FC_CHARSET element: fontconfig treats the charset as optional, and
caches produced by other fontconfig builds (e.g. a bundled snapshot
that indexed .woff/.woff2 files it could not parse as empty patterns)
can legally serve charset-less patterns. In that case the uninitialized
pointer is dereferenced inside FcCharSetHasChar() and the process
crashes with SIGSEGV; builds hardened with
-ftrivial-auto-var-init=pattern crash deterministically at 0xfefe...

upstream: https://codereview.qt-project.org/c/qt/qtbase/+/750214
log: fix crash when fontconfig fallback pattern has no charset
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind
Once this PR has been reviewed and has the lgtm label, please assign liujianqiang-niu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lzwind
lzwind merged commit 590fb47 into deepin-community:master Sep 28, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants