Fixed findings

List of Findings

Error: COMPILER_WARNING (CWE-252): [#def1]
libcbor-0.13.0/examples/cbor_sequence.c: scope_hint: In function ‘read_cbor_sequence’
libcbor-0.13.0/examples/cbor_sequence.c:68:3: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’
#   68 |   fread(buffer, 1, file_size, file);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   66|     }
#   67|   
#   68|->   fread(buffer, 1, file_size, file);
#   69|     fclose(file);
#   70|   

Error: CPPCHECK_WARNING (CWE-476): [#def2]
libcbor-0.13.0/examples/readfile.c:29: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   27|     fseek(f, 0, SEEK_SET);
#   28|     unsigned char* buffer = malloc(length);
#   29|->   fread(buffer, length, 1, f);
#   30|   
#   31|     /* Assuming `buffer` contains `length` bytes of input data */

Error: COMPILER_WARNING (CWE-252): [#def3]
libcbor-0.13.0/examples/readfile.c: scope_hint: In function ‘main’
libcbor-0.13.0/examples/readfile.c:29:3: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’
#   29 |   fread(buffer, length, 1, f);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#   27|     fseek(f, 0, SEEK_SET);
#   28|     unsigned char* buffer = malloc(length);
#   29|->   fread(buffer, length, 1, f);
#   30|   
#   31|     /* Assuming `buffer` contains `length` bytes of input data */

Error: COMPILER_WARNING (CWE-252): [#def4]
libcbor-0.13.0/examples/streaming_array.c: scope_hint: In function ‘main’
libcbor-0.13.0/examples/streaming_array.c:34:3: warning[-Wunused-result]: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’
#   34 |   scanf(argv[1], "%zu", &n);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
#   32|     if (argc != 2) usage();
#   33|     size_t n;
#   34|->   scanf(argv[1], "%zu", &n);
#   35|     out = freopen(NULL, "wb", stdout);
#   36|     if (!out) exit(1);

Error: CPPCHECK_WARNING (CWE-476): [#def5]
libcbor-0.13.0/examples/streaming_parser.c:44: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#   42|     fseek(f, 0, SEEK_SET);
#   43|     unsigned char* buffer = malloc(length);
#   44|->   fread(buffer, length, 1, f);
#   45|   
#   46|     struct cbor_callbacks callbacks = cbor_empty_callbacks;

Error: COMPILER_WARNING (CWE-252): [#def6]
libcbor-0.13.0/examples/streaming_parser.c: scope_hint: In function ‘main’
libcbor-0.13.0/examples/streaming_parser.c:44:3: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’
#   44 |   fread(buffer, length, 1, f);
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#   42|     fseek(f, 0, SEEK_SET);
#   43|     unsigned char* buffer = malloc(length);
#   44|->   fread(buffer, length, 1, f);
#   45|   
#   46|     struct cbor_callbacks callbacks = cbor_empty_callbacks;

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.97.1
diffbase-analyzer-version-cppcheck2.21.1
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-117.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namelibcbor-0.14.0-3.fc45
diffbase-store-results-to/tmp/tmpngrd5k28/libcbor-0.14.0-3.fc45.tar.xz
diffbase-time-created2026-08-03 17:09:37
diffbase-time-finished2026-08-03 17:11:02
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpngrd5k28/libcbor-0.14.0-3.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpngrd5k28/libcbor-0.14.0-3.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-117.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibcbor-0.13.0-2.fc44
store-results-to/tmp/tmp2cvwu3g1/libcbor-0.13.0-2.fc44.tar.xz
time-created2026-08-03 17:06:53
time-finished2026-08-03 17:09:09
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp2cvwu3g1/libcbor-0.13.0-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp2cvwu3g1/libcbor-0.13.0-2.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9