https://bugs.kde.org/show_bug.cgi?id=434557

Fabian Vogt <fab...@ritter-vogt.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Latest Commit|                            |https://invent.kde.org/fram
                   |                            |eworks/kwindowsystem/commit
                   |                            |/11eeb8369426a1f8cd805dadf5
                   |                            |e67d95dc5feb65
             Status|ASSIGNED                    |RESOLVED

--- Comment #2 from Fabian Vogt <fab...@ritter-vogt.de> ---
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

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to