ksystemstats-6.1.1-1.fc41

List of Defects

Error: COMPILER_WARNING (CWE-563): [#def1]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/cpu/linuxcpuplugin.cpp: scope_hint: In member function ‘void LinuxCpuPluginPrivate::addSensorsAmd(const sensors_chip_name*)’
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/cpu/linuxcpuplugin.cpp:218:29: warning[-Wunused-but-set-variable]: variable ‘tccd’ set but not used
#  218 |     sensors_feature const * tccd[8] = {nullptr};
#      |                             ^~~~
#  216|       sensors_feature const * tctl = nullptr;
#  217|       sensors_feature const * tdie = nullptr;
#  218|->     sensors_feature const * tccd[8] = {nullptr};
#  219|       while (sensors_feature const * feature = sensors_get_features(chipName, &featureNumber)) {
#  220|           const QByteArray name (feature->name);

Error: COMPILER_WARNING (CWE-563): [#def2]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/gpu/LinuxBackend.cpp:19:20: warning[-Wunused-variable]: ‘intelVendor’ defined but not used
#   19 | static const char *intelVendor = "0x8086";
#      |                    ^~~~~~~~~~~
#   17|   // Vendor ID strings, as used in sysfs
#   18|   static const char *amdVendor = "0x1002";
#   19|-> static const char *intelVendor = "0x8086";
#   20|   static const char *nvidiaVendor = "0x10de";
#   21|   

Error: CLANG_WARNING: [#def3]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/lmsensors/lmsensors.cpp:26:55: warning[cplusplus.NewDeleteLeaks]: Potential leak of memory pointed to by 'sensorObject'
#   24|       const std::array<QByteArray, 3> blacklist{"coretemp","k10temp","amdgpu"}; //already handled by other plugins
#   25|       int chipNumber = 0;
#   26|->     while (const sensors_chip_name * const chipName = sensors_get_detected_chips(nullptr, &chipNumber)) {
#   27|           if (std::find(blacklist.cbegin(), blacklist.cend(), chipName->prefix) != blacklist.cend()) {
#   28|               continue;

Error: CLANG_WARNING: [#def4]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/lmsensors/lmsensors.cpp:56:1: warning[cplusplus.NewDeleteLeaks]: Potential leak of memory pointed to by 'container'
#   54|           }
#   55|       }
#   56|-> }
#   57|   
#   58|   LmSensorsPlugin::~LmSensorsPlugin()

Error: CLANG_WARNING: [#def5]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:57:23: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#   55|           }
#   56|       }
#   57|->     m_total->setValue(total);
#   58|       m_used->setValue(total - available);
#   59|       m_free->setValue(available);

Error: COMPILER_WARNING (CWE-457): [#def6]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:58:21: warning[-Wmaybe-uninitialized]: ‘available’ may be used uninitialized
#   58 |     m_used->setValue(total - available);
#      |     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:32:37: note: ‘available’ was declared here
#   32 |     unsigned long long total, free, available, buffer, cache, slab, swapTotal, swapFree;
#      |                                     ^~~~~~~~~
#   56|       }
#   57|       m_total->setValue(total);
#   58|->     m_used->setValue(total - available);
#   59|       m_free->setValue(available);
#   60|       m_application->setValue(total - free - cache - buffer - slab);

Error: COMPILER_WARNING (CWE-457): [#def7]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp: scope_hint: In member function ‘LinuxMemoryBackend::update()’
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:58:21: warning[-Wmaybe-uninitialized]: ‘total’ may be used uninitialized
#   58 |     m_used->setValue(total - available);
#      |     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:32:24: note: ‘total’ was declared here
#   32 |     unsigned long long total, free, available, buffer, cache, slab, swapTotal, swapFree;
#      |                        ^~~~~
#   56|       }
#   57|       m_total->setValue(total);
#   58|->     m_used->setValue(total - available);
#   59|       m_free->setValue(available);
#   60|       m_application->setValue(total - free - cache - buffer - slab);

Error: COMPILER_WARNING (CWE-457): [#def8]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:60:35: warning[-Wmaybe-uninitialized]: ‘free’ may be used uninitialized
#   60 |     m_application->setValue(total - free - cache - buffer - slab);
#      |                             ~~~~~~^~~~~~
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:32:31: note: ‘free’ was declared here
#   32 |     unsigned long long total, free, available, buffer, cache, slab, swapTotal, swapFree;
#      |                               ^~~~
#   58|       m_used->setValue(total - available);
#   59|       m_free->setValue(available);
#   60|->     m_application->setValue(total - free - cache - buffer - slab);
#   61|       m_cache->setValue(cache + slab);
#   62|       m_buffer->setValue(buffer);

Error: COMPILER_WARNING (CWE-457): [#def9]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:61:22: warning[-Wmaybe-uninitialized]: ‘cache’ may be used uninitialized
#   61 |     m_cache->setValue(cache + slab);
#      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:32:56: note: ‘cache’ was declared here
#   32 |     unsigned long long total, free, available, buffer, cache, slab, swapTotal, swapFree;
#      |                                                        ^~~~~
#   59|       m_free->setValue(available);
#   60|       m_application->setValue(total - free - cache - buffer - slab);
#   61|->     m_cache->setValue(cache + slab);
#   62|       m_buffer->setValue(buffer);
#   63|       m_swapTotal->setValue(swapTotal);

Error: COMPILER_WARNING (CWE-457): [#def10]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:61:22: warning[-Wmaybe-uninitialized]: ‘slab’ may be used uninitialized
#   61 |     m_cache->setValue(cache + slab);
#      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:32:63: note: ‘slab’ was declared here
#   32 |     unsigned long long total, free, available, buffer, cache, slab, swapTotal, swapFree;
#      |                                                               ^~~~
#   59|       m_free->setValue(available);
#   60|       m_application->setValue(total - free - cache - buffer - slab);
#   61|->     m_cache->setValue(cache + slab);
#   62|       m_buffer->setValue(buffer);
#   63|       m_swapTotal->setValue(swapTotal);

Error: COMPILER_WARNING (CWE-457): [#def11]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:62:23: warning[-Wmaybe-uninitialized]: ‘buffer’ may be used uninitialized
#   62 |     m_buffer->setValue(buffer);
#      |     ~~~~~~~~~~~~~~~~~~^~~~~~~~
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:32:48: note: ‘buffer’ was declared here
#   32 |     unsigned long long total, free, available, buffer, cache, slab, swapTotal, swapFree;
#      |                                                ^~~~~~
#   60|       m_application->setValue(total - free - cache - buffer - slab);
#   61|       m_cache->setValue(cache + slab);
#   62|->     m_buffer->setValue(buffer);
#   63|       m_swapTotal->setValue(swapTotal);
#   64|       m_swapUsed->setValue(swapTotal - swapFree);

Error: COMPILER_WARNING (CWE-457): [#def12]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:64:25: warning[-Wmaybe-uninitialized]: ‘swapTotal’ may be used uninitialized
#   64 |     m_swapUsed->setValue(swapTotal - swapFree);
#      |     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:32:69: note: ‘swapTotal’ was declared here
#   32 |     unsigned long long total, free, available, buffer, cache, slab, swapTotal, swapFree;
#      |                                                                     ^~~~~~~~~
#   62|       m_buffer->setValue(buffer);
#   63|       m_swapTotal->setValue(swapTotal);
#   64|->     m_swapUsed->setValue(swapTotal - swapFree);
#   65|       m_swapFree->setValue(swapFree);
#   66|   }

Error: COMPILER_WARNING (CWE-457): [#def13]
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:65:25: warning[-Wmaybe-uninitialized]: ‘swapFree’ may be used uninitialized
#   65 |     m_swapFree->setValue(swapFree);
#      |     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
ksystemstats-6.1.1-build/ksystemstats-6.1.1/plugins/memory/linuxbackend.cpp:32:80: note: ‘swapFree’ was declared here
#   32 |     unsigned long long total, free, available, buffer, cache, slab, swapTotal, swapFree;
#      |                                                                                ^~~~~~~~
#   63|       m_swapTotal->setValue(swapTotal);
#   64|       m_swapUsed->setValue(swapTotal - swapFree);
#   65|->     m_swapFree->setValue(swapFree);
#   66|   }
#   67|   

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-63.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-nameksystemstats-6.1.1-1.fc41
store-results-to/tmp/tmp465jbi1i/ksystemstats-6.1.1-1.fc41.tar.xz
time-created2024-07-03 14:29:15
time-finished2024-07-03 14:31:19
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp465jbi1i/ksystemstats-6.1.1-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp465jbi1i/ksystemstats-6.1.1-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9