Bug 372945 - kscreen-console monitor crashes when the primary display changes
Summary: kscreen-console monitor crashes when the primary display changes
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.8.4
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-26 10:48 UTC by Jan-Matthias Braun
Modified: 2016-11-27 22:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.8.5
Sentry Crash Report:


Attachments
Fix the nullptr-access with by guarding the access to the OutputPtr with an if. (727 bytes, patch)
2016-11-26 10:48 UTC, Jan-Matthias Braun
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan-Matthias Braun 2016-11-26 10:48:51 UTC
Created attachment 102444 [details]
Fix the nullptr-access with by guarding the access to the OutputPtr with an if.

In console.cpp, line 74 the OutputPtr is used unconditionally, but in my case, a new primary output comes with two calls to primaryOutputChanged, one with an empty OutputPtr and one with the new primary output.
Comment 1 Sebastian Kügler 2016-11-27 22:21:19 UTC
Git commit d79dc2b8ca4f8c9daf6c6e6f5f3e40580f6d224c by Sebastian Kügler.
Committed on 27/11/2016 at 22:20.
Pushed by sebas into branch 'Plasma/5.8'.

guard against nullptr-access to the OutputPtr

output may be null here, as we don't necessarily have a primary display.
Guard against that case.

Patch by Jan-Matthias Braun, thanks!

CCMAIL:jan_braun@gmx.net
FIXED-IN:5.8.5

M  +6    -1    console/console.cpp

https://commits.kde.org/kscreen/d79dc2b8ca4f8c9daf6c6e6f5f3e40580f6d224c
Comment 2 Sebastian Kügler 2016-11-27 22:22:15 UTC
Git commit d72edf2795a4a7206a89751264a61a7b3d652ffe by Sebastian Kügler.
Committed on 27/11/2016 at 22:22.
Pushed by sebas into branch 'master'.

guard against nullptr-access to the OutputPtr

output may be null here, as we don't necessarily have a primary display.
Guard against that case.

Patch by Jan-Matthias Braun, thanks!

CCMAIL:jan_braun@gmx.net
FIXED-IN:5.8.5

M  +6    -1    console/console.cpp

https://commits.kde.org/kscreen/d72edf2795a4a7206a89751264a61a7b3d652ffe
Comment 3 Sebastian Kügler 2016-11-27 22:25:13 UTC
Hi Jan-Matthias,

Thanks a lot for the patch! I've reviewed and merged it into the stable and master branches, and it'll be available in 5.8.5.

We usually use phabricator for patch workflows, so if you have anything in the future, you may want to checkout phabricator.kde.org.

Again, thanks for the patch and rock on!