Null pointer dereference at ksysguard
ClosedPublic

Authored by gkaragiannidis on May 11 2019, 9:21 PM.

Details

Summary

Attempting to write to a NULL pointer, if the

strchr( confLog->name, ':' );

has returned null.
This can happen in case a config file doesn't have the ":" symbol.
The application crashes this way.

File: ksysguardd/conf.c

Test Plan

Using this file, and running
ksysguardd -d -i -p 1234 -f segfaultrigger.txt a segmentation fault is generated:

root@pc:~# ksysguardd -d -i -p 1234 -f segtrig.txt 
ksysguardd 4
(c) 1999, 2000, 2001, 2002 Chris Schlaeger <cs@kde.org>
(c) 2001 Tobias Koenig <tokoe@kde.org>
(c) 2006-2008 Greg Martyn <greg.martyn@gmail.com>
This program is part of the KDE Project and licensed under
the GNU GPL version 2. See http://www.kde.org for details.
Segmentation fault

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
gkaragiannidis created this revision.May 11 2019, 9:21 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 11 2019, 9:21 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
gkaragiannidis requested review of this revision.May 11 2019, 9:21 PM
gkaragiannidis retitled this revision from Null pointer dereference at line 111 in conf.c to Null pointer dereference at ksysguard.May 11 2019, 10:03 PM
gkaragiannidis edited the summary of this revision. (Show Details)
gkaragiannidis edited the test plan for this revision. (Show Details)May 11 2019, 11:07 PM
apol added a subscriber: apol.May 12 2019, 12:33 AM

+1 overall.

ksysguardd/conf.c
111

it would probably read better as if (tmp).

gkaragiannidis marked an inline comment as done.May 12 2019, 5:24 PM

Yes it would read better indeed.
I don't know the procedure though; should I do anything?

I don't know the procedure though; should I do anything?

You can update a diff

davidedmundson accepted this revision.May 28 2019, 8:36 AM
This revision is now accepted and ready to land.May 28 2019, 8:36 AM
This revision was automatically updated to reflect the committed changes.