kf6-kcrash-6.8.0-1.fc42

List of Findings

Error: COMPILER_WARNING (CWE-252): [#def1]
kf6-kcrash-6.8.0-build/kcrash-6.8.0/src/metadata.cpp: scope_hint: In constructor ‘KCrash::MetadataINIWriter::MetadataINIWriter(const QByteArray&)’
kf6-kcrash-6.8.0-build/kcrash-6.8.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): [#def2]
kf6-kcrash-6.8.0-build/kcrash-6.8.0/src/metadata.cpp: scope_hint: In member function ‘virtual void KCrash::MetadataINIWriter::add(const char*, const char*, KCrash::MetadataWriter::BoolValue)’
kf6-kcrash-6.8.0-build/kcrash-6.8.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): [#def3]
kf6-kcrash-6.8.0-build/kcrash-6.8.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): [#def4]
kf6-kcrash-6.8.0-build/kcrash-6.8.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): [#def5]
kf6-kcrash-6.8.0-build/kcrash-6.8.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): [#def6]
kf6-kcrash-6.8.0-build/kcrash-6.8.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): [#def7]
kf6-kcrash-6.8.0-build/kcrash-6.8.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-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-22.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namekf6-kcrash-6.8.0-1.fc42
store-results-to/tmp/tmpxrrrpwrf/kf6-kcrash-6.8.0-1.fc42.tar.xz
time-created2024-11-13 00:44:46
time-finished2024-11-13 00:46:13
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpxrrrpwrf/kf6-kcrash-6.8.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpxrrrpwrf/kf6-kcrash-6.8.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9