libcbor-0.13.0-1.fc44
List of Findings
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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’
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)
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)
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)
Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
libcbor-0.13.0/examples/readfile.c:25:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_resource: opened here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:25:3: throw: if ‘fseek’ throws an exception...
libcbor-0.13.0/examples/readfile.c:25:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libcbor-0.13.0/examples/readfile.c:25:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_memory: allocated here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:25:3: throw: if ‘fseek’ throws an exception...
libcbor-0.13.0/examples/readfile.c:25:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
libcbor-0.13.0/examples/readfile.c:26:27: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_resource: opened here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:26:27: throw: if ‘ftell’ throws an exception...
libcbor-0.13.0/examples/readfile.c:26:27: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
libcbor-0.13.0/examples/readfile.c:26:27: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_memory: allocated here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:26:27: throw: if ‘ftell’ throws an exception...
libcbor-0.13.0/examples/readfile.c:26:27: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
libcbor-0.13.0/examples/readfile.c:27:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_resource: opened here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:27:3: throw: if ‘fseek’ throws an exception...
libcbor-0.13.0/examples/readfile.c:27:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libcbor-0.13.0/examples/readfile.c:27:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_memory: allocated here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:27:3: throw: if ‘fseek’ throws an exception...
libcbor-0.13.0/examples/readfile.c:27:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
Error: CPPCHECK_WARNING (CWE-476): [#def25]
libcbor-0.13.0/examples/readfile.c:29: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
Error: COMPILER_WARNING (CWE-252): [#def26]
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’
Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
libcbor-0.13.0/examples/readfile.c:33:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_resource: opened here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:33:23: throw: if ‘cbor_load’ throws an exception...
libcbor-0.13.0/examples/readfile.c:33:23: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
libcbor-0.13.0/examples/readfile.c:33:23: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:28:27: acquire_memory: allocated here
libcbor-0.13.0/examples/readfile.c:33:23: throw: if ‘cbor_load’ throws an exception...
libcbor-0.13.0/examples/readfile.c:33:23: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
libcbor-0.13.0/examples/readfile.c:33:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_memory: allocated here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:33:23: throw: if ‘cbor_load’ throws an exception...
libcbor-0.13.0/examples/readfile.c:33:23: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
libcbor-0.13.0/examples/readfile.c:36:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_resource: opened here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:36:7: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
libcbor-0.13.0/examples/readfile.c:36:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/readfile.c:22:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/readfile.c:23:13: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:23:13: acquire_memory: allocated here
libcbor-0.13.0/examples/readfile.c:24:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/readfile.c:25:3: branch_false: ...to here
libcbor-0.13.0/examples/readfile.c:36:7: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
Error: COMPILER_WARNING (CWE-252): [#def32]
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’
Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
libcbor-0.13.0/examples/streaming_parser.c:40:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:38:13: acquire_resource: opened here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:40:3: throw: if ‘fseek’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:40:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
libcbor-0.13.0/examples/streaming_parser.c:40:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:38:13: acquire_memory: allocated here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:40:3: throw: if ‘fseek’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:40:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
libcbor-0.13.0/examples/streaming_parser.c:41:27: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:38:13: acquire_resource: opened here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:41:27: throw: if ‘ftell’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:41:27: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
libcbor-0.13.0/examples/streaming_parser.c:41:27: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:38:13: acquire_memory: allocated here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:41:27: throw: if ‘ftell’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:41:27: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
libcbor-0.13.0/examples/streaming_parser.c:42:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:38:13: acquire_resource: opened here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:42:3: throw: if ‘fseek’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:42:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
libcbor-0.13.0/examples/streaming_parser.c:42:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:38:13: acquire_memory: allocated here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:42:3: throw: if ‘fseek’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:42:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
Error: CPPCHECK_WARNING (CWE-476): [#def39]
libcbor-0.13.0/examples/streaming_parser.c:44: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
Error: COMPILER_WARNING (CWE-252): [#def40]
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’
Error: CPPCHECK_WARNING (CWE-682): [#def41]
libcbor-0.13.0/examples/streaming_parser.c:51: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
libcbor-0.13.0/examples/streaming_parser.c:51:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:38:13: acquire_resource: opened here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:50:10: branch_true: following ‘true’ branch (when ‘bytes_read < length’)...
libcbor-0.13.0/examples/streaming_parser.c:51:21: branch_true: ...to here
libcbor-0.13.0/examples/streaming_parser.c:51:21: throw: if ‘cbor_stream_decode’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:51:21: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
libcbor-0.13.0/examples/streaming_parser.c:51:21: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:43:27: acquire_memory: allocated here
libcbor-0.13.0/examples/streaming_parser.c:50:10: branch_true: following ‘true’ branch (when ‘bytes_read < length’)...
libcbor-0.13.0/examples/streaming_parser.c:51:21: branch_true: ...to here
libcbor-0.13.0/examples/streaming_parser.c:51:21: throw: if ‘cbor_stream_decode’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:51:21: danger: ‘buffer’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
libcbor-0.13.0/examples/streaming_parser.c:51:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libcbor-0.13.0/examples/streaming_parser.c:37:6: branch_false: following ‘false’ branch (when ‘argc == 2’)...
libcbor-0.13.0/examples/streaming_parser.c:38:13: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:38:13: acquire_memory: allocated here
libcbor-0.13.0/examples/streaming_parser.c:39:6: branch_false: following ‘false’ branch...
libcbor-0.13.0/examples/streaming_parser.c:40:3: branch_false: ...to here
libcbor-0.13.0/examples/streaming_parser.c:50:10: branch_true: following ‘true’ branch (when ‘bytes_read < length’)...
libcbor-0.13.0/examples/streaming_parser.c:51:21: branch_true: ...to here
libcbor-0.13.0/examples/streaming_parser.c:51:21: throw: if ‘cbor_stream_decode’ throws an exception...
libcbor-0.13.0/examples/streaming_parser.c:51:21: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
Error: COMPILER_WARNING (CWE-686): [#def45]
libcbor-0.13.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-8rqYMg/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘ldexp’; expected ‘double(double, int)’
Error: CPPCHECK_WARNING (CWE-457): [#def46]
libcbor-0.13.0/src/cbor/internal/unicode.c:62: warning[uninitvar]: Uninitialized variable: *codep
Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
libcbor-0.13.0/test/cbor_serialize_test.c:132:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:131:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:132:3: throw: if ‘cbor_bytestring_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:132:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
Error: CPPCHECK_WARNING (CWE-476): [#def48]
libcbor-0.13.0/test/cbor_serialize_test.c:133: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
Error: CPPCHECK_WARNING (CWE-476): [#def49]
libcbor-0.13.0/test/cbor_serialize_test.c:146: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
Error: GCC_ANALYZER_WARNING (CWE-688): [#def50]
libcbor-0.13.0/test/cbor_serialize_test.c:146:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
libcbor-0.13.0/test/cbor_serialize_test.c:145:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/cbor_serialize_test.c:146:3: danger: argument 1 (‘data’) from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
libcbor-0.13.0/test/cbor_serialize_test.c:147:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:145:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:147:3: throw: if ‘cbor_bytestring_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:147:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
libcbor-0.13.0/test/cbor_serialize_test.c:166:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:165:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:166:3: throw: if ‘cbor_bytestring_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:166:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
libcbor-0.13.0/test/cbor_serialize_test.c:177:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:176:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:177:3: throw: if ‘cbor_bytestring_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:177:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libcbor-0.13.0/test/cbor_serialize_test.c:189:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:188:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:189:3: throw: if ‘cbor_bytestring_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:189:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-688): [#def55]
libcbor-0.13.0/test/cbor_serialize_test.c:208:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
libcbor-0.13.0/test/cbor_serialize_test.c:207:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/cbor_serialize_test.c:208:3: danger: argument 1 (‘data’) from [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libcbor-0.13.0/test/cbor_serialize_test.c:209:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:207:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:209:3: throw: if ‘cbor_string_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:209:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-688): [#def57]
libcbor-0.13.0/test/cbor_serialize_test.c:226:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
libcbor-0.13.0/test/cbor_serialize_test.c:225:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/cbor_serialize_test.c:226:3: danger: argument 1 (‘data’) from [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
libcbor-0.13.0/test/cbor_serialize_test.c:227:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:225:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:227:3: throw: if ‘cbor_string_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:227:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-476): [#def59]
libcbor-0.13.0/test/cbor_serialize_test.c:239:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:238:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/cbor_serialize_test.c:239:3: danger: ‘data’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
libcbor-0.13.0/test/cbor_serialize_test.c:240:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:238:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:240:3: throw: if ‘cbor_string_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:240:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-688): [#def61]
libcbor-0.13.0/test/cbor_serialize_test.c:253:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
libcbor-0.13.0/test/cbor_serialize_test.c:252:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/cbor_serialize_test.c:253:3: danger: argument 1 (‘data’) from [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
libcbor-0.13.0/test/cbor_serialize_test.c:254:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:252:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:254:3: throw: if ‘cbor_string_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:254:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
Error: CPPCHECK_WARNING (CWE-476): [#def63]
libcbor-0.13.0/test/cbor_serialize_test.c:272: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
Error: GCC_ANALYZER_WARNING (CWE-688): [#def64]
libcbor-0.13.0/test/cbor_serialize_test.c:272:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
libcbor-0.13.0/test/cbor_serialize_test.c:271:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/cbor_serialize_test.c:272:3: danger: argument 1 (‘data’) from [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
libcbor-0.13.0/test/cbor_serialize_test.c:273:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:271:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:273:3: throw: if ‘cbor_string_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:273:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
Error: CPPCHECK_WARNING (CWE-476): [#def66]
libcbor-0.13.0/test/cbor_serialize_test.c:285: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
Error: GCC_ANALYZER_WARNING (CWE-688): [#def67]
libcbor-0.13.0/test/cbor_serialize_test.c:285:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
libcbor-0.13.0/test/cbor_serialize_test.c:284:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/cbor_serialize_test.c:285:3: danger: argument 1 (‘data’) from [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
libcbor-0.13.0/test/cbor_serialize_test.c:286:3: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/cbor_serialize_test.c:284:25: acquire_memory: allocated here
libcbor-0.13.0/test/cbor_serialize_test.c:286:3: throw: if ‘cbor_string_set_handle’ throws an exception...
libcbor-0.13.0/test/cbor_serialize_test.c:286:3: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
Error: CPPCHECK_WARNING (CWE-476): [#def69]
libcbor-0.13.0/test/fuzz_test.c:43: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
Error: GCC_ANALYZER_WARNING (CWE-476): [#def70]
libcbor-0.13.0/test/fuzz_test.c:43:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
libcbor-0.13.0/test/fuzz_test.c:41:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/fuzz_test.c:42:22: branch_true: following ‘true’ branch (when ‘i < length’)...
libcbor-0.13.0/test/fuzz_test.c:43:15: branch_true: ...to here
libcbor-0.13.0/test/fuzz_test.c:43:5: danger: ‘data + i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
libcbor-0.13.0/test/fuzz_test.c:50:10: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/fuzz_test.c:41:25: acquire_memory: allocated here
libcbor-0.13.0/test/fuzz_test.c:42:22: branch_false: following ‘false’ branch (when ‘i >= length’)...
libcbor-0.13.0/test/fuzz_test.c:50:10: branch_false: ...to here
libcbor-0.13.0/test/fuzz_test.c:50:10: throw: if ‘cbor_load’ throws an exception...
libcbor-0.13.0/test/fuzz_test.c:50:10: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
libcbor-0.13.0/test/fuzz_test.c:52:40: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/fuzz_test.c:41:25: acquire_memory: allocated here
libcbor-0.13.0/test/fuzz_test.c:42:22: branch_false: following ‘false’ branch (when ‘i >= length’)...
libcbor-0.13.0/test/fuzz_test.c:50:10: branch_false: ...to here
libcbor-0.13.0/test/fuzz_test.c:52:6: branch_true: following ‘true’ branch...
libcbor-0.13.0/test/fuzz_test.c:52:40: branch_true: ...to here
libcbor-0.13.0/test/fuzz_test.c:52:40: throw: if ‘cbor_decref’ throws an exception...
libcbor-0.13.0/test/fuzz_test.c:52:40: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
Error: CPPCHECK_WARNING (CWE-476): [#def73]
libcbor-0.13.0/test/memory_utils_test.c:41: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
Error: GCC_ANALYZER_WARNING (CWE-476): [#def74]
libcbor-0.13.0/test/memory_utils_test.c:41:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
libcbor-0.13.0/test/memory_utils_test.c:40:25: acquire_memory: this call could return NULL
libcbor-0.13.0/test/memory_utils_test.c:41:3: danger: ‘data’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
libcbor-0.13.0/test/memory_utils_test.c:43:10: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libcbor-0.13.0/test/memory_utils_test.c:40:25: acquire_memory: allocated here
libcbor-0.13.0/test/memory_utils_test.c:43:10: throw: if ‘_cbor_realloc_multiple’ throws an exception...
libcbor-0.13.0/test/memory_utils_test.c:43:10: danger: ‘data’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
libcbor-0.13.0/test/pretty_printer_test.c:20:3: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
libcbor-0.13.0/test/pretty_printer_test.c:19:19: acquire_memory: allocated here
libcbor-0.13.0/test/pretty_printer_test.c:20:3: throw: if ‘cbor_describe’ throws an exception...
libcbor-0.13.0/test/pretty_printer_test.c:20:3: danger: ‘tmpfile()’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
Error: CPPCHECK_WARNING (CWE-476): [#def77]
libcbor-0.13.0/test/pretty_printer_test.c:21: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: outfile
Error: CPPCHECK_WARNING (CWE-476): [#def78]
libcbor-0.13.0/test/pretty_printer_test.c:26: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: outfile
Error: CPPCHECK_WARNING (CWE-476): [#def79]
libcbor-0.13.0/test/pretty_printer_test.c:29: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: outfile
Error: CPPCHECK_WARNING (CWE-476): [#def80]
libcbor-0.13.0/test/pretty_printer_test.c:31: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: outfile
Error: CPPCHECK_WARNING (CWE-476): [#def81]
libcbor-0.13.0/test/stack_over_limit_test.c:8: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: *overflow_data
Error: GCC_ANALYZER_WARNING (CWE-476): [#def82]
libcbor-0.13.0/test/stack_over_limit_test.c:8:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*overflow_data’
libcbor-0.13.0/test/stack_over_limit_test.c:6:36: acquire_memory: this call could return NULL
libcbor-0.13.0/test/stack_over_limit_test.c:7:15: branch_true: following ‘true’ branch (when ‘i != 2049’)...
libcbor-0.13.0/test/stack_over_limit_test.c:8:5: branch_true: ...to here
libcbor-0.13.0/test/stack_over_limit_test.c:8:5: danger: ‘*overflow_data + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
Error: GCC_ANALYZER_WARNING (CWE-476): [#def83]
libcbor-0.13.0/test/stack_over_limit_test.c:8:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘overflow_data’
libcbor-0.13.0/test/stack_over_limit_test.c:15:13: enter_function: entry to ‘test_stack_over_limit’
libcbor-0.13.0/test/stack_over_limit_test.c:19:23: call_function: calling ‘generate_overflow_data’ from ‘test_stack_over_limit’
Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
libcbor-0.13.0/test/stack_over_limit_test.c:20:3: warning[-Wanalyzer-malloc-leak]: leak of ‘overflow_data’
libcbor-0.13.0/test/stack_over_limit_test.c:15:13: enter_function: entry to ‘test_stack_over_limit’
libcbor-0.13.0/test/stack_over_limit_test.c:19:23: call_function: calling ‘generate_overflow_data’ from ‘test_stack_over_limit’
libcbor-0.13.0/test/stack_over_limit_test.c:19:23: return_function: returning to ‘test_stack_over_limit’ from ‘generate_overflow_data’
libcbor-0.13.0/test/stack_over_limit_test.c:20:3: throw: if ‘cbor_load’ throws an exception...
libcbor-0.13.0/test/stack_over_limit_test.c:20:3: danger: ‘overflow_data’ leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
Error: CPPCHECK_WARNING (CWE-476): [#def85]
libcbor-0.13.0/test/string_test.c:298: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: string_data
Error: GCC_ANALYZER_WARNING (CWE-688): [#def86]
libcbor-0.13.0/test/string_test.c:298:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘string_data’ where non-null expected
libcbor-0.13.0/test/string_test.c:297:32: acquire_memory: this call could return NULL
libcbor-0.13.0/test/string_test.c:298:3: danger: argument 1 (‘string_data’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: CPPCHECK_WARNING (CWE-476): [#def87]
libcbor-0.13.0/test/string_test.c:314: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: string_data
Error: GCC_ANALYZER_WARNING (CWE-688): [#def88]
libcbor-0.13.0/test/string_test.c:314:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘string_data’ where non-null expected
libcbor-0.13.0/test/string_test.c:313:32: acquire_memory: this call could return NULL
libcbor-0.13.0/test/string_test.c:314:3: danger: argument 1 (‘string_data’) from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: CPPCHECK_WARNING (CWE-476): [#def89]
libcbor-0.13.0/test/string_test.c:330: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: string_data
Error: GCC_ANALYZER_WARNING (CWE-688): [#def90]
libcbor-0.13.0/test/string_test.c:330:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘string_data’ where non-null expected
libcbor-0.13.0/test/string_test.c:329:32: acquire_memory: this call could return NULL
libcbor-0.13.0/test/string_test.c:330:3: danger: argument 1 (‘string_data’) from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
Error: CPPCHECK_WARNING (CWE-476): [#def91]
libcbor-0.13.0/test/test_allocator.c:22: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: expectations
Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
libcbor-0.13.0/test/test_allocator.c:22:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘expectations’
libcbor-0.13.0/test/test_allocator.c:19:18: acquire_memory: this call could return NULL
libcbor-0.13.0/test/test_allocator.c:20:19: branch_true: following ‘true’ branch (when ‘i < calls’)...
libcbor-0.13.0/test/test_allocator.c:22:17: branch_true: ...to here
libcbor-0.13.0/test/test_allocator.c:22:5: danger: ‘expectations + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
Scan Properties
| 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 |
| 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 |
| 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 |