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

            Bug ID: 405346
           Summary: Fix out of bounds access error in SystemLoadViewer.qml
           Product: kdeplasma-addons
           Version: 5.15.2
          Platform: Archlinux Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: systemloadviewer
          Assignee: plasma-b...@kde.org
          Reporter: kde....@estada.ch
  Target Milestone: ---

Created attachment 118712
  --> https://bugs.kde.org/attachment.cgi?id=118712&action=edit
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")
        }

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

Reply via email to