Bug 405346 - Fix out of bounds access error in SystemLoadViewer.qml
Summary: Fix out of bounds access error in SystemLoadViewer.qml
Status: RESOLVED WORKSFORME
Alias: None
Product: kdeplasma-addons
Classification: Plasma
Component: systemloadviewer (show other bugs)
Version: 5.15.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-11 10:31 UTC by dns2utf8
Modified: 2020-11-15 04:33 UTC (History)
0 users

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


Attachments
The complete fixed file (21.66 KB, text/x-csrc)
2019-03-11 10:31 UTC, dns2utf8
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dns2utf8 2019-03-11 10:31:49 UTC
Created attachment 118712 [details]
The complete fixed file

SUMMARY
I made this patch to the file but I was unable to submit the patch to version control, because I did not find the correct repo.


STEPS TO REPRODUCE
1. Fix code locally
2. Search repo to upstream
3. Fail
4. ...
5. Submit bug instead

OBSERVED RESULT
file:///usr/share/plasma/plasmoids/org.kde.plasma.systemloadviewer/contents/ui/SystemLoadViewer.qml:251: TypeError: Cannot read property 'value' of undefined


EXPECTED RESULT
Nothing

SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: Arch Linux (5.0.0 kernel)
(available in About System)
KDE Plasma Version: 5.15.2
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.1

ADDITIONAL INFORMATION
From line 251 to the end of the function, replace everything with this:

        var cacheDirty = parseFloat(dataSource.data[dataSource.cacheDirty] ? dataSource.data[dataSource.cacheDirty].value : 0) / 1024
        var cacheWriteback = parseFloat(dataSource.data[dataSource.cacheWriteback] ? dataSource.data[dataSource.cacheWriteback].value : 0) / 1024
        var cachePart = i18n("Cache Dirty, Writeback: %1 MiB, %2 MiB", Math.round(cacheDirty), Math.round(cacheWriteback))

        if (cpuClockPart === "") {
            return [cpuLoadPart, memoryPart, swapPart, cachePart].join("\n")
        }
        else {
            return [cpuLoadPart, cpuClockPart, memoryPart, swapPart, cachePart].join("\n")
        }
Comment 1 Christoph Feck 2019-03-31 09:25:27 UTC
Please add patches to https://phabricator.kde.org/differential/diff/create/

For more information, see https://community.kde.org/Infrastructure/Phabricator
Comment 2 Nate Graham 2020-10-16 02:16:24 UTC
Is this still an issue or relevant with the new System Monitor applet in Plasma 5.19 and beyond?
Comment 3 Bug Janitor Service 2020-10-31 04:33:32 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2020-11-15 04:33:41 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!