Summary: | KXMessages::broadcastMessageX triggers deprecated QByteArray behavior | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kwindowsystem | Reporter: | Nicolas Fella <nicolas.fella> |
Component: | general | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | a.samirh78, kde, vlad.zahorodnii |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/kwindowsystem/commit/11eeb8369426a1f8cd805dadf5e67d95dc5feb65 | Version Fixed In: | |
Sentry Crash Report: |
Description
Nicolas Fella
2021-03-17 18:39:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwindowsystem/-/merge_requests/40 Git commit 11eeb8369426a1f8cd805dadf5e67d95dc5feb65 by Fabian Vogt. Committed on 16/12/2021 at 22:30. Pushed by fvogt into branch 'master'. Avoid using QByteArray::operator[] for the null terminator While QByteArray has an implicit null terminator at the end, this is not meant to be accessible through operator[]. In Qt 5, OOB accesses return 0 (and cause a warning in later versions), but in Qt 6 it's forbidden entirely. Rewrite the code slightly to just avoid reading the null terminator altogether. For completeness, this also zeros the remaining buffer when Xlib events are used. Also replace use of strlen with QByteArray::size(). M +9 -6 src/platforms/xcb/kxmessages.cpp https://invent.kde.org/frameworks/kwindowsystem/commit/11eeb8369426a1f8cd805dadf5e67d95dc5feb65 |