Review Request 127837: oxygen_windeco: Fix potential use-after-free from improper use of QCache<QPixmap>
Michael Pyne
mpyne at kde.org
Sat May 7 04:24:42 UTC 2016
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127837/
-----------------------------------------------------------
(Updated May 7, 2016, 4:24 a.m.)
Status
------
This change has been marked as submitted.
Review request for KDE Frameworks and Plasma.
Changes
-------
Submitted with commit b595f47f021cbcf1cee23cd0bee1df57a2e2f1b9 by Michael Pyne to branch master.
Repository: oxygen
Description
-------
oxygen windeco: Fix use-after-free for pixmap in QCache.
Coverity identified (in CID 1336171) a usage of QPixmap after it's been
the parameter to QCache<QPixmap>::insert.
This is unsafe since QCache gains ownership of whatever object is passed
in, and can even (at least in theory) delete the object you pass in.
Instead give the QCache its own copy of the pixmap.
To make this work without leaking our existing pixmap we need to work
with a QPixmap instead of QPixmap* in the non-cached case. This leads to
whitespace changes; use git diff -b to filter pure whitespace changes
out.
Diffs
-----
kdecoration/oxygendecohelper.cpp a7e9306
Diff: https://git.reviewboard.kde.org/r/127837/diff/
Testing
-------
The new code compiles but I'm currently unable to test since kcmshell5 kwindecoration (and any other KCM viewer) is currently crashing for me in QML, due to what I'm sure is a local misconfiguration...
Thanks,
Michael Pyne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160507/0d85a88a/attachment.html>
More information about the Plasma-devel
mailing list