fix: fix crash when fontconfig fallback pattern has no charset - #68
Conversation
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
TAG Bot TAG: 6.8.0+dfsg-0deepin37 |
f4a9d48 to
e036834
Compare
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
e036834 to
113b8e5
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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