Error: GCC_ANALYZER_WARNING (CWE-775): [#def1] libcbor-0.13.0/examples/cbor_sequence.c:21:27: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’ libcbor-0.13.0/examples/cbor_sequence.c:14:16: acquire_resource: opened here libcbor-0.13.0/examples/cbor_sequence.c:15:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:21:27: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:21:27: throw: if ‘cbor_build_uint32’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:21:27: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 19| # 20| // Create example CBOR items # 21|-> cbor_item_t* int_item = cbor_build_uint32(42); # 22| cbor_item_t* string_item = cbor_build_string("Hello, CBOR!"); # 23| cbor_item_t* array_item = cbor_new_definite_array(2); Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] libcbor-0.13.0/examples/cbor_sequence.c:21:27: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’ libcbor-0.13.0/examples/cbor_sequence.c:14:16: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:15:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:21:27: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:21:27: throw: if ‘cbor_build_uint32’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:21:27: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 19| # 20| // Create example CBOR items # 21|-> cbor_item_t* int_item = cbor_build_uint32(42); # 22| cbor_item_t* string_item = cbor_build_string("Hello, CBOR!"); # 23| cbor_item_t* array_item = cbor_new_definite_array(2); Error: GCC_ANALYZER_WARNING (CWE-775): [#def3] libcbor-0.13.0/examples/cbor_sequence.c:22:30: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’ libcbor-0.13.0/examples/cbor_sequence.c:14:16: acquire_resource: opened here libcbor-0.13.0/examples/cbor_sequence.c:15:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:21:27: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:22:30: throw: if ‘cbor_build_string’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:22:30: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) # 20| // Create example CBOR items # 21| cbor_item_t* int_item = cbor_build_uint32(42); # 22|-> cbor_item_t* string_item = cbor_build_string("Hello, CBOR!"); # 23| cbor_item_t* array_item = cbor_new_definite_array(2); # 24| assert(cbor_array_push(array_item, cbor_build_uint8(1))); Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] libcbor-0.13.0/examples/cbor_sequence.c:22:30: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’ libcbor-0.13.0/examples/cbor_sequence.c:14:16: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:15:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:21:27: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:22:30: throw: if ‘cbor_build_string’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:22:30: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0) # 20| // Create example CBOR items # 21| cbor_item_t* int_item = cbor_build_uint32(42); # 22|-> cbor_item_t* string_item = cbor_build_string("Hello, CBOR!"); # 23| cbor_item_t* array_item = cbor_new_definite_array(2); # 24| assert(cbor_array_push(array_item, cbor_build_uint8(1))); Error: GCC_ANALYZER_WARNING (CWE-775): [#def5] libcbor-0.13.0/examples/cbor_sequence.c:23:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’ libcbor-0.13.0/examples/cbor_sequence.c:14:16: acquire_resource: opened here libcbor-0.13.0/examples/cbor_sequence.c:15:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:21:27: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:23:29: throw: if ‘cbor_new_definite_array’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:23:29: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0) # 21| cbor_item_t* int_item = cbor_build_uint32(42); # 22| cbor_item_t* string_item = cbor_build_string("Hello, CBOR!"); # 23|-> cbor_item_t* array_item = cbor_new_definite_array(2); # 24| assert(cbor_array_push(array_item, cbor_build_uint8(1))); # 25| assert(cbor_array_push(array_item, cbor_build_uint8(2))); Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] libcbor-0.13.0/examples/cbor_sequence.c:23:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’ libcbor-0.13.0/examples/cbor_sequence.c:14:16: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:15:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:21:27: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:23:29: throw: if ‘cbor_new_definite_array’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:23:29: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0) # 21| cbor_item_t* int_item = cbor_build_uint32(42); # 22| cbor_item_t* string_item = cbor_build_string("Hello, CBOR!"); # 23|-> cbor_item_t* array_item = cbor_new_definite_array(2); # 24| assert(cbor_array_push(array_item, cbor_build_uint8(1))); # 25| assert(cbor_array_push(array_item, cbor_build_uint8(2))); Error: GCC_ANALYZER_WARNING (CWE-775): [#def7] libcbor-0.13.0/examples/cbor_sequence.c:31:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "wb")’ libcbor-0.13.0/examples/cbor_sequence.c:14:16: acquire_resource: opened here libcbor-0.13.0/examples/cbor_sequence.c:15:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:21:27: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:31:3: throw: if ‘cbor_serialize_alloc’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:31:3: danger: ‘fopen(filename, "wb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0) # 29| size_t buffer_size; # 30| # 31|-> cbor_serialize_alloc(int_item, &buffer, &buffer_size); # 32| fwrite(buffer, 1, buffer_size, file); # 33| free(buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def8] libcbor-0.13.0/examples/cbor_sequence.c:31:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "wb")’ libcbor-0.13.0/examples/cbor_sequence.c:14:16: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:15:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:21:27: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:31:3: throw: if ‘cbor_serialize_alloc’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:31:3: danger: ‘fopen(filename, "wb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0) # 29| size_t buffer_size; # 30| # 31|-> cbor_serialize_alloc(int_item, &buffer, &buffer_size); # 32| fwrite(buffer, 1, buffer_size, file); # 33| free(buffer); Error: GCC_ANALYZER_WARNING (CWE-775): [#def9] libcbor-0.13.0/examples/cbor_sequence.c:57:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’ libcbor-0.13.0/examples/cbor_sequence.c:51:16: acquire_resource: opened here libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:57:3: throw: if ‘fseek’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:57:3: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0) # 55| } # 56| # 57|-> fseek(file, 0, SEEK_END); # 58| size_t file_size = ftell(file); # 59| fseek(file, 0, SEEK_SET); Error: GCC_ANALYZER_WARNING (CWE-401): [#def10] libcbor-0.13.0/examples/cbor_sequence.c:57:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’ libcbor-0.13.0/examples/cbor_sequence.c:51:16: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:57:3: throw: if ‘fseek’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:57:3: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/0) # 55| } # 56| # 57|-> fseek(file, 0, SEEK_END); # 58| size_t file_size = ftell(file); # 59| fseek(file, 0, SEEK_SET); Error: GCC_ANALYZER_WARNING (CWE-775): [#def11] libcbor-0.13.0/examples/cbor_sequence.c:58:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’ libcbor-0.13.0/examples/cbor_sequence.c:51:16: acquire_resource: opened here libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:58:22: throw: if ‘ftell’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:58:22: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/0) # 56| # 57| fseek(file, 0, SEEK_END); # 58|-> size_t file_size = ftell(file); # 59| fseek(file, 0, SEEK_SET); # 60| Error: GCC_ANALYZER_WARNING (CWE-401): [#def12] libcbor-0.13.0/examples/cbor_sequence.c:58:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’ libcbor-0.13.0/examples/cbor_sequence.c:51:16: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:58:22: throw: if ‘ftell’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:58:22: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0) # 56| # 57| fseek(file, 0, SEEK_END); # 58|-> size_t file_size = ftell(file); # 59| fseek(file, 0, SEEK_SET); # 60| Error: GCC_ANALYZER_WARNING (CWE-775): [#def13] libcbor-0.13.0/examples/cbor_sequence.c:59:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’ libcbor-0.13.0/examples/cbor_sequence.c:51:16: acquire_resource: opened here libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:59:3: throw: if ‘fseek’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:59:3: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0) # 57| fseek(file, 0, SEEK_END); # 58| size_t file_size = ftell(file); # 59|-> fseek(file, 0, SEEK_SET); # 60| # 61| unsigned char* buffer = malloc(file_size); Error: GCC_ANALYZER_WARNING (CWE-401): [#def14] libcbor-0.13.0/examples/cbor_sequence.c:59:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’ libcbor-0.13.0/examples/cbor_sequence.c:51:16: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:59:3: throw: if ‘fseek’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:59:3: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/0) # 57| fseek(file, 0, SEEK_END); # 58| size_t file_size = ftell(file); # 59|-> fseek(file, 0, SEEK_SET); # 60| # 61| unsigned char* buffer = malloc(file_size); Error: COMPILER_WARNING (CWE-252): [#def15] 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: GCC_ANALYZER_WARNING (CWE-401): [#def16] libcbor-0.13.0/examples/cbor_sequence.c:75:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:61:27: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:62:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... libcbor-0.13.0/examples/cbor_sequence.c:68:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:74:10: branch_true: following ‘true’ branch (when ‘offset < file_size’)... libcbor-0.13.0/examples/cbor_sequence.c:75:25: branch_true: ...to here libcbor-0.13.0/examples/cbor_sequence.c:75:25: throw: if ‘cbor_load’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:75:25: danger: ‘buffer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2) # 73| # 74| while (offset < file_size) { # 75|-> cbor_item_t* item = cbor_load(buffer + offset, file_size - offset, &result); # 76| if (result.error.code != CBOR_ERR_NONE) { # 77| fprintf(stderr, "Error: Failed to parse CBOR item at offset %zu\n", Error: GCC_ANALYZER_WARNING (CWE-401): [#def17] libcbor-0.13.0/examples/cbor_sequence.c:82:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:61:27: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:62:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... libcbor-0.13.0/examples/cbor_sequence.c:68:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:74:10: branch_true: following ‘true’ branch (when ‘offset < file_size’)... libcbor-0.13.0/examples/cbor_sequence.c:75:25: branch_true: ...to here libcbor-0.13.0/examples/cbor_sequence.c:76:8: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:82:5: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:82:5: throw: if ‘cbor_describe’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:82:5: danger: ‘buffer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2) # 80| } # 81| # 82|-> cbor_describe(item, stdout); # 83| printf("\n"); # 84| Error: GCC_ANALYZER_WARNING (CWE-401): [#def18] libcbor-0.13.0/examples/cbor_sequence.c:86:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ libcbor-0.13.0/examples/cbor_sequence.c:52:6: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:57:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:61:27: acquire_memory: allocated here libcbor-0.13.0/examples/cbor_sequence.c:62:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... libcbor-0.13.0/examples/cbor_sequence.c:68:3: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:74:10: branch_true: following ‘true’ branch (when ‘offset < file_size’)... libcbor-0.13.0/examples/cbor_sequence.c:75:25: branch_true: ...to here libcbor-0.13.0/examples/cbor_sequence.c:76:8: branch_false: following ‘false’ branch... libcbor-0.13.0/examples/cbor_sequence.c:82:5: branch_false: ...to here libcbor-0.13.0/examples/cbor_sequence.c:86:5: throw: if ‘cbor_decref’ throws an exception... libcbor-0.13.0/examples/cbor_sequence.c:86:5: danger: ‘buffer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/2) # 84| # 85| offset += result.read; # 86|-> cbor_decref(&item); # 87| } # 88|
| analyzer-version-clippy | 1.92.0 |
| analyzer-version-cppcheck | 2.19.1 |
| analyzer-version-gcc | 16.0.0 |
| analyzer-version-gcc-analyzer | 16.0.0 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.92.0 |
| diffbase-analyzer-version-cppcheck | 2.19.1 |
| diffbase-analyzer-version-gcc | 16.0.0 |
| diffbase-analyzer-version-gcc-analyzer | 16.0.0 |
| diffbase-analyzer-version-shellcheck | 0.11.0 |
| diffbase-analyzer-version-unicontrol | 0.0.2 |
| diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| diffbase-exit-code | 0 |
| diffbase-host | ip-172-16-1-191.us-west-2.compute.internal |
| diffbase-known-false-positives | /usr/share/csmock/known-false-positives.js |
| diffbase-known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | libcbor-0.12.0-6.fc43 |
| diffbase-store-results-to | /tmp/tmpxks1lwru/libcbor-0.12.0-6.fc43.tar.xz |
| diffbase-time-created | 2026-01-08 18:38:55 |
| diffbase-time-finished | 2026-01-08 18:41:14 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpxks1lwru/libcbor-0.12.0-6.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpxks1lwru/libcbor-0.12.0-6.fc43.src.rpm' |
| diffbase-tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-191.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | libcbor-0.13.0-1.fc44 |
| store-results-to | /tmp/tmpcy1hdgkw/libcbor-0.13.0-1.fc44.tar.xz |
| time-created | 2026-01-08 18:41:39 |
| time-finished | 2026-01-08 18:43:27 |
| title | Newly introduced findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpcy1hdgkw/libcbor-0.13.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpcy1hdgkw/libcbor-0.13.0-1.fc44.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |