kf6-kcrash-6.3.0-1.fc41
List of Defects
Error: COMPILER_WARNING (CWE-563): [#def1]
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/kcrash.cpp: scope_hint: In function ‘void KCrash::initialize()’
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/kcrash.cpp:235:18: warning[-Wunused-variable]: unused variable ‘guiApp’
# 235 | if (auto guiApp = qobject_cast<QGuiApplication *>(QCoreApplication::instance())) {
# | ^~~~~~
# 233| s_appFilePath.reset(qstrdup(qPrintable(path))); // This intentionally cannot be changed by the application!
# 234| KCrash::setApplicationFilePath(path);
# 235|-> if (auto guiApp = qobject_cast<QGuiApplication *>(QCoreApplication::instance())) {
# 236| s_glRenderer.reset(qstrdup(glRenderer().toUtf8().constData()));
# 237| }
Error: COMPILER_WARNING (CWE-252): [#def2]
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp: scope_hint: In constructor ‘KCrash::MetadataINIWriter::MetadataINIWriter(const QByteArray&)’
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp:35:14: warning[-Wunused-result]: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’
# 35 | write(fd, header, strlen(header));
# | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 33| writable = true;
# 34| const char *header = "[KCrash]\n";
# 35|-> write(fd, header, strlen(header));
# 36| } else {
# 37| fprintf(stderr, "MetadataINIWriter: Unexpected fd %d\n", fd);
Error: COMPILER_WARNING (CWE-252): [#def3]
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp: scope_hint: In member function ‘virtual void KCrash::MetadataINIWriter::add(const char*, const char*, KCrash::MetadataWriter::BoolValue)’
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp:63:10: warning[-Wunused-result]: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’
# 63 | write(fd, key + 2, strlen(key + 2));
# | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 61| const auto valueSpan = std::span{value, strlen(value)};
# 62|
# 63|-> write(fd, key + 2, strlen(key + 2));
# 64| write(fd, "=", 1);
# 65| if (strstr(value, "\n")) { // if it contains \n then write literally \n (2 characters)
Error: COMPILER_WARNING (CWE-252): [#def4]
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp:64:10: warning[-Wunused-result]: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’
# 64 | write(fd, "=", 1);
# | ~~~~~^~~~~~~~~~~~
# 62|
# 63| write(fd, key + 2, strlen(key + 2));
# 64|-> write(fd, "=", 1);
# 65| if (strstr(value, "\n")) { // if it contains \n then write literally \n (2 characters)
# 66| // Could appear in the exception what() string. KConfig knows what to do with this.
Error: COMPILER_WARNING (CWE-252): [#def5]
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp:69:22: warning[-Wunused-result]: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’
# 69 | write(fd, "\\n", 2);
# | ~~~~~^~~~~~~~~~~~~~
# 67| for (const auto &character : valueSpan) {
# 68| if (character == '\n') {
# 69|-> write(fd, "\\n", 2);
# 70| } else {
# 71| write(fd, &character, 1);
Error: COMPILER_WARNING (CWE-252): [#def6]
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp:71:22: warning[-Wunused-result]: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’
# 71 | write(fd, &character, 1);
# | ~~~~~^~~~~~~~~~~~~~~~~~~
# 69| write(fd, "\\n", 2);
# 70| } else {
# 71|-> write(fd, &character, 1);
# 72| }
# 73| }
Error: COMPILER_WARNING (CWE-252): [#def7]
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp:75:14: warning[-Wunused-result]: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’
# 75 | write(fd, valueSpan.data(), valueSpan.size());
# | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 73| }
# 74| } else { // fast write entire string in one go since it contains no newlines
# 75|-> write(fd, valueSpan.data(), valueSpan.size());
# 76| }
# 77| write(fd, "\n", 1);
Error: COMPILER_WARNING (CWE-252): [#def8]
kf6-kcrash-6.3.0-build/kcrash-6.3.0/src/metadata.cpp:77:10: warning[-Wunused-result]: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’
# 77 | write(fd, "\n", 1);
# | ~~~~~^~~~~~~~~~~~~
# 75| write(fd, valueSpan.data(), valueSpan.size());
# 76| }
# 77|-> write(fd, "\n", 1);
# 78| }
# 79|
Scan Properties
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-63.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | kf6-kcrash-6.3.0-1.fc41 |
store-results-to | /tmp/tmpmulghfm9/kf6-kcrash-6.3.0-1.fc41.tar.xz |
time-created | 2024-07-03 14:01:10 |
time-finished | 2024-07-03 14:02:21 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpmulghfm9/kf6-kcrash-6.3.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpmulghfm9/kf6-kcrash-6.3.0-1.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |