nvme-cli-2.13-1.fc43

List of Findings

Error: CPPCHECK_WARNING (CWE-404): [#def1]
nvme-cli-2.13/fabrics.c:449: error[resourceLeak]: Resource leak: f
#  447|   	argv = calloc(MAX_DISC_ARGS, sizeof(char *));
#  448|   	if (!argv)
#  449|-> 		return -1;
#  450|   
#  451|   	argv[0] = "discover";

Error: CPPCHECK_WARNING (CWE-476): [#def2]
nvme-cli-2.13/nbft.c:62: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: entry
#   60|   		if (!ret) {
#   61|   			entry = calloc(1, sizeof(*entry));
#   62|-> 			entry->nbft = nbft;
#   63|   			list_add_tail(nbft_list, &entry->node);
#   64|   		}

Error: CPPCHECK_WARNING (CWE-404): [#def3]
nvme-cli-2.13/nvme-rpmb.c:226: error[resourceLeak]: Resource leak: fp
#  224|   			temp_folder, msg ? msg : "");
#  225|   	}
#  226|-> }
#  227|   
#  228|   /* Various definitions used in RPMB related support */

Error: CPPCHECK_WARNING (CWE-476): [#def4]
nvme-cli-2.13/nvme-rpmb.c:700: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rsp
#  698|   	/* send the request to get the result and then request to get the response */
#  699|           rsp = (struct rpmb_data_frame_t *)calloc(rsp_size, 1);
#  700|-> 	rsp->target = req->target;
#  701|   	rsp->type = RPMB_REQ_READ_RESULT;
#  702|   	error = send_rpmb_req(fd, tgt, rsp_size, rsp);

Error: CPPCHECK_WARNING (CWE-476): [#def5]
nvme-cli-2.13/nvme-rpmb.c:701: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rsp
#  699|           rsp = (struct rpmb_data_frame_t *)calloc(rsp_size, 1);
#  700|   	rsp->target = req->target;
#  701|-> 	rsp->type = RPMB_REQ_READ_RESULT;
#  702|   	error = send_rpmb_req(fd, tgt, rsp_size, rsp);
#  703|   	if (error != 0 || rsp->result != 0) {

Error: CPPCHECK_WARNING (CWE-476): [#def6]
nvme-cli-2.13/nvme-rpmb.c:703: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rsp
#  701|   	rsp->type = RPMB_REQ_READ_RESULT;
#  702|   	error = send_rpmb_req(fd, tgt, rsp_size, rsp);
#  703|-> 	if (error != 0 || rsp->result != 0) {
#  704|   		fprintf(stderr, "Write-data read result 0x%x, error = 0x%x\n",
#  705|   			rsp->result, error);

Error: CPPCHECK_WARNING (CWE-476): [#def7]
nvme-cli-2.13/nvme-rpmb.c:967: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: msg_buf
#  965|   				msg_size = strlen(cfg.msg);
#  966|   				msg_buf = (unsigned char *)malloc(msg_size);
#  967|-> 				memcpy(msg_buf, cfg.msg, msg_size);
#  968|   			} else {
#  969|   				err = read_file(cfg.msgfile, &msg_buf, &msg_size);

Error: CPPCHECK_WARNING (CWE-457): [#def8]
nvme-cli-2.13/nvme.c:4795: warning[uninitvar]: Uninitialized variable: result_def
# 4793|   	}
# 4794|   
# 4795|-> 	if (err || !cfg.changed || err_def || result != result_def ||
# 4796|   	    (buf && buf_def && !strcmp(buf, buf_def)))
# 4797|   		get_feature_id_print(cfg, err, result, buf, flags);

Error: CPPCHECK_WARNING (CWE-457): [#def9]
nvme-cli-2.13/nvme.c:5558: warning[uninitvar]: Uninitialized variable: err
# 5556|   	}
# 5557|   
# 5558|-> 	if (err)
# 5559|   		free(bar);
# 5560|   	else

Error: CPPCHECK_WARNING (CWE-404): [#def10]
nvme-cli-2.13/nvme.c:9971: error[resourceLeak]: Resource leak: fd
# 9969|   	if (cnt != 1) {
# 9970|   		nvme_show_error("Must specify either --import, --export or --revoke");
# 9971|-> 		return -EINVAL;
# 9972|   	} else if (cfg.export) {
# 9973|   		err = nvme_scan_tls_keys(cfg.keyring, __scan_tls_key, fd);

Error: CPPCHECK_WARNING (CWE-404): [#def11]
nvme-cli-2.13/nvme.c:9999: error[resourceLeak]: Resource leak: fd
# 9997|   			nvme_show_error("Failed to revoke key '%s'",
# 9998|   					nvme_strerror(errno));
# 9999|-> 			return err;
#10000|   		}
#10001|   

Error: CPPCHECK_WARNING (CWE-457): [#def12]
nvme-cli-2.13/plugins/innogrit/innogrit-nvme.c:72: error[uninitvar]: Uninitialized variable: pdrvinfo->signature
#   70|   	for (ilogid = 0xe1; ilogid < 0xe2; ilogid++) {
#   71|   		getlogpage(dev, ilogid, 0, data, 4096, NULL);
#   72|-> 		if (pdrvinfo->signature == 0x5A)
#   73|   			return 1;
#   74|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def13]
nvme-cli-2.13/plugins/innogrit/innogrit-nvme.c:114: error[uninitvar]: Uninitialized variable: pevlog->signature
#  112|   		}
#  113|   
#  114|-> 		if (pevlog->signature == EVLOG_SIG) {
#  115|   			errcnt = 0;
#  116|   		} else {

Error: CPPCHECK_WARNING (CWE-476): [#def14]
nvme-cli-2.13/plugins/innogrit/innogrit-nvme.c:211: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#  209|   		ret = getvsc_eventlog(dev, fp);
#  210|   
#  211|-> 	fclose(fp);
#  212|   	dev_close(dev);
#  213|   	chmod(filename, 0666);

Error: CPPCHECK_WARNING (CWE-404): [#def15]
nvme-cli-2.13/plugins/innogrit/innogrit-nvme.c:305: error[resourceLeak]: Resource leak: fp
#  303|   	if (itotal == 0) {
#  304|   		printf("no cdump data\n");
#  305|-> 		return 0;
#  306|   	}
#  307|   

Error: CPPCHECK_WARNING (CWE-456): [#def16]
nvme-cli-2.13/plugins/intel/intel-nvme.c:1352: error[uninitdata]: Memory is allocated but not initialized: intel
# 1350|   	struct intel_vu_log *intel = malloc(sizeof(struct intel_vu_log));
# 1351|   	struct intel_vu_nlog *intel_nlog = (struct intel_vu_nlog *)buf;
# 1352|-> 	struct intel_assert_dump *ad = (struct intel_assert_dump *) intel->reserved;
# 1353|   	struct intel_event_header *ehdr = (struct intel_event_header *)intel->reserved;
# 1354|   	struct nvme_dev *dev;

Error: CPPCHECK_WARNING (CWE-476): [#def17]
nvme-cli-2.13/plugins/intel/intel-nvme.c:1352: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: intel
# 1350|   	struct intel_vu_log *intel = malloc(sizeof(struct intel_vu_log));
# 1351|   	struct intel_vu_nlog *intel_nlog = (struct intel_vu_nlog *)buf;
# 1352|-> 	struct intel_assert_dump *ad = (struct intel_assert_dump *) intel->reserved;
# 1353|   	struct intel_event_header *ehdr = (struct intel_event_header *)intel->reserved;
# 1354|   	struct nvme_dev *dev;

Error: CPPCHECK_WARNING (CWE-476): [#def18]
nvme-cli-2.13/plugins/intel/intel-nvme.c:1353: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: intel
# 1351|   	struct intel_vu_nlog *intel_nlog = (struct intel_vu_nlog *)buf;
# 1352|   	struct intel_assert_dump *ad = (struct intel_assert_dump *) intel->reserved;
# 1353|-> 	struct intel_event_header *ehdr = (struct intel_event_header *)intel->reserved;
# 1354|   	struct nvme_dev *dev;
# 1355|   

Error: CPPCHECK_WARNING (CWE-404): [#def19]
nvme-cli-2.13/plugins/lm/lm-nvme.c:381: error[resourceLeak]: Resource leak: file
#  379|   		data = nvme_alloc_huge(cfg.numd << 2, &mh);
#  380|   		if (!data)
#  381|-> 			return -ENOMEM;
#  382|   
#  383|   		size_t n_data = fread(data, 1, cfg.numd << 2, file);

Error: CPPCHECK_WARNING (CWE-758): [#def20]
nvme-cli-2.13/plugins/micron/micron-nvme.c:1084: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1082|   	/* For M51CX models, PCIe errors are cleared using 0xC3 feature */
# 1083|   	if (model == M51CX) {
# 1084|-> 		err = nvme_set_features_simple(dev_fd(dev), fid, 0, (1 << 31), false,
# 1085|   					       &result);
# 1086|   		if (!err)

Error: CPPCHECK_WARNING (CWE-401): [#def21]
nvme-cli-2.13/plugins/micron/micron-nvme.c:1850: error[memleakOnRealloc]: Common realloc mistake: 'buffer' nulled but not freed upon failure
# 1848|   	offset = bs;
# 1849|   	err = 0;
# 1850|-> 	buffer = (unsigned char *)realloc(buffer, (size_t)(*logSize));
# 1851|   	if (buffer) {
# 1852|   		while (!err && offset != *logSize) {

Error: CPPCHECK_WARNING (CWE-758): [#def22]
nvme-cli-2.13/plugins/micron/micron-nvme.c:2690: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 2688|   	}
# 2689|   
# 2690|-> 	err = nvme_set_features_simple(dev_fd(dev), fid, 1 << 31, 0, 0, &result);
# 2691|   	if (!err)
# 2692|   		err = (int)result;

Error: CPPCHECK_WARNING (CWE-758): [#def23]
nvme-cli-2.13/plugins/ocp/ocp-clear-features.c:18: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   16|   {
#   17|   	__u32 result = 0;
#   18|-> 	__u32 clear = 1 << 31;
#   19|   	struct nvme_dev *dev;
#   20|   	__u8 uuid_index = 0;

Error: CPPCHECK_WARNING (CWE-682): [#def24]
nvme-cli-2.13/plugins/ocp/ocp-nvme.c:968: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
#  966|   		}
#  967|   
#  968|-> 		print_telemetry_da_stat((void *)(da1_stat + (temp_ofst - da1_off)), tele_type,
#  969|   					le64_to_cpu(da1->da1_stat_size) * 4, 1);
#  970|   	}

Error: CPPCHECK_WARNING (CWE-682): [#def25]
nvme-cli-2.13/plugins/ocp/ocp-nvme.c:1020: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
# 1018|   				return err;
# 1019|   			}
# 1020|-> 			print_telemetry_da_fifo((void *)(da1_fifo + (temp_ofst - da1_off)), temp_sz,
# 1021|   						tele_type, le64_to_cpu(da1->event_fifo_da[i]), i);
# 1022|   		}

Error: CPPCHECK_WARNING (CWE-682): [#def26]
nvme-cli-2.13/plugins/ocp/ocp-nvme.c:1076: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
# 1074|   		}
# 1075|   
# 1076|-> 		print_telemetry_da_stat((void *)(da2_stat + (temp_ofst - da1_off)), tele_type,
# 1077|   					le64_to_cpu(da1->da2_stat_size) * 4, 2);
# 1078|   	}

Error: CPPCHECK_WARNING (CWE-682): [#def27]
nvme-cli-2.13/plugins/ocp/ocp-nvme.c:1126: error[nullPointerArithmeticOutOfMemory]: If memory allocation fail: pointer addition with NULL pointer.
# 1124|   				return err;
# 1125|   			}
# 1126|-> 			print_telemetry_da_fifo((void *)(da1_fifo + (temp_ofst - da1_off)), temp_sz,
# 1127|   						tele_type, le64_to_cpu(da1->event_fifo_da[i]), i);
# 1128|   		}

Error: CPPCHECK_WARNING (CWE-476): [#def28]
nvme-cli-2.13/plugins/ocp/ocp-telemetry-decode.c:474: warning[nullPointer]: Possible null pointer dereference: pdata
#  472|   
#  473|   	for (size_t i = 0; i < data_size; ++i) {
#  474|-> 		sprintf(temp_buffer, "%02X", pdata[i]);
#  475|   		strcat(description_str, temp_buffer);
#  476|   	}

Error: CPPCHECK_WARNING (CWE-476): [#def29]
nvme-cli-2.13/plugins/ocp/ocp-telemetry-decode.c:475: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: description_str
#  473|   	for (size_t i = 0; i < data_size; ++i) {
#  474|   		sprintf(temp_buffer, "%02X", pdata[i]);
#  475|-> 		strcat(description_str, temp_buffer);
#  476|   	}
#  477|   

Error: CPPCHECK_WARNING (CWE-476): [#def30]
nvme-cli-2.13/plugins/ocp/ocp-telemetry-decode.c:989: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: description
#  987|   	char *description = (char *)malloc((40 + 1) * sizeof(char));
#  988|   
#  989|-> 	memset(description, 0, sizeof(40));
#  990|   
#  991|   	status =

Error: CPPCHECK_WARNING (CWE-476): [#def31]
nvme-cli-2.13/plugins/ocp/ocp-telemetry-decode.c:1002: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: description
# 1000|   
# 1001|   	snprintf(event_fifo_name, sizeof(event_fifo_name), "%s%d%s%s", "EVENT FIFO ",
# 1002|-> 		 event_fifo_number, " - ", description);
# 1003|   
# 1004|   	struct json_object *pevent_fifo_array = NULL;

Error: CPPCHECK_WARNING (CWE-457): [#def32]
nvme-cli-2.13/plugins/solidigm/solidigm-internal-logs.c:403: warning[uninitvar]: Uninitialized variable: nlog_header->totalnlogs
#  401|   				return err;
#  402|   			}
#  403|-> 			count = nlog_header->totalnlogs;
#  404|   			core_num = core < 0 ? nlog_header->corecount : 0;
#  405|   			if (!header_size) {

Error: CPPCHECK_WARNING (CWE-457): [#def33]
nvme-cli-2.13/plugins/solidigm/solidigm-telemetry/nlog.c:122: warning[uninitvar]: Uninitialized variable: str_mismatches
#  120|   				       offset_tail_mismatches[best_offset][i]);
#  121|   
#  122|-> 		SOLIDIGM_LOG_WARNING("%s:%d with %d header mismatches ( %s). Configuration file may be missing format headers.",
#  123|   				      name, media_bank, smaller_tail_count, str_mismatches);
#  124|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def34]
nvme-cli-2.13/plugins/solidigm/solidigm-workload-tracker.c:477: warning[uninitvar]: Uninitialized variable: dest
#  475|   static void join_fields(char *dest, struct field *fields)
#  476|   {
#  477|-> 	strcat(dest, fields[0].name);
#  478|   	for (int i = 1; i < MAX_FIELDS; i++) {
#  479|   		char *name = fields[i].name;

Error: CPPCHECK_WARNING (CWE-758): [#def35]
nvme-cli-2.13/plugins/wdc/wdc-nvme.c:8921: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 8919|   	int ret;
# 8920|   	__u32 result;
# 8921|-> 	__u32 value = 1 << 31; /* Bit 31 - clear PCIe correctable count */
# 8922|   
# 8923|   	ret = nvme_set_features_simple(fd, WDC_NVME_CLEAR_PCIE_CORR_FEATURE_ID, 0, value,

Error: CPPCHECK_WARNING (CWE-758): [#def36]
nvme-cli-2.13/plugins/wdc/wdc-nvme.c:9401: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 9399|   	int ret = -1;
# 9400|   	__u32 result;
# 9401|-> 	__u32 value = 1 << 31; /* Bit 31 - Clear Firmware Update History Log */
# 9402|   
# 9403|   	ret = nvme_set_features_simple(fd, WDC_NVME_CLEAR_FW_ACT_HIST_VU_FID, 0, value,

Error: CPPCHECK_WARNING (CWE-476): [#def37]
nvme-cli-2.13/plugins/wdc/wdc-nvme.c:10168: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vuLogInput
#10166|   	/* define inputs for vendor unique log pages */
#10167|   	vuLogInput = (struct WDC_NVME_DE_VU_LOGPAGES *)calloc(1, sizeof(struct WDC_NVME_DE_VU_LOGPAGES));
#10168|-> 	vuLogInput->numOfVULogPages = ARRAY_SIZE(deVULogPagesList);
#10169|   
#10170|   	for (vuLogIdx = 0; vuLogIdx < vuLogInput->numOfVULogPages; vuLogIdx++) {

Error: CPPCHECK_WARNING (CWE-476): [#def38]
nvme-cli-2.13/plugins/wdc/wdc-nvme.c:10170: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vuLogInput
#10168|   	vuLogInput->numOfVULogPages = ARRAY_SIZE(deVULogPagesList);
#10169|   
#10170|-> 	for (vuLogIdx = 0; vuLogIdx < vuLogInput->numOfVULogPages; vuLogIdx++) {
#10171|   		dataBufferSize = deVULogPagesList[vuLogIdx].logPageLen;
#10172|   		dataBuffer = calloc(1, dataBufferSize);

Error: CPPCHECK_WARNING (CWE-476): [#def39]
nvme-cli-2.13/plugins/wdc/wdc-nvme.c:10173: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dataBuffer
#10171|   		dataBufferSize = deVULogPagesList[vuLogIdx].logPageLen;
#10172|   		dataBuffer = calloc(1, dataBufferSize);
#10173|-> 		memset(dataBuffer, 0, dataBufferSize);
#10174|   
#10175|   		ret = nvme_get_log_simple(dev_fd(dev),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
nvme-cli-2.13/redhat-linux-build/../nbft.c:55:24: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
nvme-cli-2.13/redhat-linux-build/../nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’
nvme-cli-2.13/redhat-linux-build/../nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)...
nvme-cli-2.13/redhat-linux-build/../nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’
nvme-cli-2.13/redhat-linux-build/../nbft.c:306:15: call_function: calling ‘read_nbft_files’ from ‘discover_from_nbft’
#   53|   	count = scandir(path, &dent, nbft_filter, NULL);
#   54|   	if (count < 0)
#   55|-> 		return -errno;
#   56|   
#   57|   	for (i = 0; i < count; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
nvme-cli-2.13/redhat-linux-build/../nbft.c:61:33: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
nvme-cli-2.13/redhat-linux-build/../nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’
nvme-cli-2.13/redhat-linux-build/../nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)...
nvme-cli-2.13/redhat-linux-build/../nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’
nvme-cli-2.13/redhat-linux-build/../nbft.c:306:15: call_function: calling ‘read_nbft_files’ from ‘discover_from_nbft’
#   59|   		ret = nvme_nbft_read(&nbft, filename);
#   60|   		if (!ret) {
#   61|-> 			entry = calloc(1, sizeof(*entry));
#   62|   			entry->nbft = nbft;
#   63|   			list_add_tail(nbft_list, &entry->node);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
nvme-cli-2.13/redhat-linux-build/../nbft.c:62:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘entry’
nvme-cli-2.13/redhat-linux-build/../nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’
nvme-cli-2.13/redhat-linux-build/../nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)...
nvme-cli-2.13/redhat-linux-build/../nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’
nvme-cli-2.13/redhat-linux-build/../nbft.c:306:15: call_function: calling ‘read_nbft_files’ from ‘discover_from_nbft’
#   60|   		if (!ret) {
#   61|   			entry = calloc(1, sizeof(*entry));
#   62|-> 			entry->nbft = nbft;
#   63|   			list_add_tail(nbft_list, &entry->node);
#   64|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:323:19: warning[-Wanalyzer-malloc-leak]: leak of ‘rpmb_md5(&num, 4)’
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:839:5: enter_function: entry to ‘rpmb_cmd_option’
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:908:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:912:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:913:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:916:34: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:917:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:923:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:923:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:950:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:950:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:951:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:956:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:956:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:962:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:962:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme-rpmb.c:981:31: call_function: calling ‘rpmb_read_write_counter’ from ‘rpmb_cmd_option’
#  321|   	int num = rand();
#  322|   	unsigned char *hash = rpmb_md5((unsigned char *)&num, sizeof(num));
#  323|-> 	if (hash) memcpy(req->nonce, hash, sizeof(req->nonce));
#  324|   }
#  325|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
nvme-cli-2.13/redhat-linux-build/../nvme.c:5576:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6176:12: enter_function: entry to ‘set_register’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6182:45: release_memory: ‘dev’ is NULL
nvme-cli-2.13/redhat-linux-build/../nvme.c:6211:15: call_function: calling ‘parse_and_open’ from ‘set_register’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6211:15: return_function: returning to ‘set_register’ from ‘parse_and_open’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6212:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6215:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6215:13: release_memory: ‘dev’ is NULL
nvme-cli-2.13/redhat-linux-build/../nvme.c:6215:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6220:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6220:15: call_function: calling ‘mmap_registers’ from ‘set_register’
# 5574|   		prot |= PROT_WRITE;
# 5575|   
# 5576|-> 	sprintf(path, "/sys/class/nvme/%s/device/resource0", dev->name);
# 5577|   	fd = open(path, writable ? O_RDWR : O_RDONLY);
# 5578|   	if (fd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
nvme-cli-2.13/redhat-linux-build/../nvme.c:6687:39: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cfg.file, 0)’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6578:12: enter_function: entry to ‘set_feature’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6633:15: call_function: calling ‘parse_and_open’ from ‘set_feature’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6633:15: return_function: returning to ‘set_feature’ from ‘parse_and_open’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6634:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6637:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6638:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6643:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6654:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6659:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6659:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6664:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6669:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6670:23: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6671:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6682:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6682:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6686:36: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6686:28: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6687:39: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6687:39: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6687:39: danger: ‘open(cfg.file, 0)’ leaks here; was opened at [(50)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/49)
# 6685|   		} else {
# 6686|   			if (strlen(cfg.file))
# 6687|-> 				ffd = open(cfg.file, O_RDONLY);
# 6688|   
# 6689|   			if (ffd < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
nvme-cli-2.13/redhat-linux-build/../nvme.c:6808:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cfg.file, 0)’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6743:12: enter_function: entry to ‘sec_send’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6786:15: call_function: calling ‘parse_and_open’ from ‘sec_send’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6786:15: return_function: returning to ‘sec_send’ from ‘parse_and_open’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6787:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6790:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6791:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6796:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6796:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6800:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6800:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6804:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6804:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6808:26: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6808:26: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6808:26: danger: ‘open(cfg.file, 0)’ leaks here; was opened at [(44)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/43)
# 6806|   		sec_size = cfg.tl;
# 6807|   	} else {
# 6808|-> 		sec_fd = open(cfg.file, O_RDONLY);
# 6809|   		if (sec_fd < 0) {
# 6810|   			nvme_show_error("Failed to open %s: %s", cfg.file, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
nvme-cli-2.13/redhat-linux-build/../nvme.c:6954:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cfg.file, 0)’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6860:12: enter_function: entry to ‘dir_send’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6912:15: call_function: calling ‘parse_and_open’ from ‘dir_send’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6912:15: return_function: returning to ‘dir_send’ from ‘parse_and_open’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6913:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6916:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6932:17: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6946:13: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6946:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6947:23: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6948:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6953:28: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6953:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6954:31: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6954:31: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6954:31: danger: ‘open(cfg.file, 0)’ leaks here; was opened at [(23)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/22)
# 6952|   	if (buf) {
# 6953|   		if (strlen(cfg.file)) {
# 6954|-> 			ffd = open(cfg.file, O_RDONLY);
# 6955|   			if (ffd <= 0) {
# 6956|   				nvme_show_error("Failed to open file %s: %s",

Error: GCC_ANALYZER_WARNING: [#def48]
nvme-cli-2.13/redhat-linux-build/../nvme.c:6961:23: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘ffd’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6860:12: enter_function: entry to ‘dir_send’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6912:15: call_function: calling ‘parse_and_open’ from ‘dir_send’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6912:15: return_function: returning to ‘dir_send’ from ‘parse_and_open’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6913:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6916:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6932:17: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6946:13: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6946:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6947:23: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6948:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6953:28: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6953:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6954:31: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6954:31: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6955:28: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6961:46: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6961:23: danger: ‘ffd’ could be invalid: unchecked value from [(23)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/22)
# 6959|   			}
# 6960|   		}
# 6961|-> 		err = read(ffd, (void *)buf, cfg.data_len);
# 6962|   		if (err < 0) {
# 6963|   			nvme_show_error("failed to read data buffer from input file %s",

Error: GCC_ANALYZER_WARNING: [#def49]
nvme-cli-2.13/redhat-linux-build/../nvme.c:9147:29: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘mfd’
nvme-cli-2.13/redhat-linux-build/../nvme.c:9016:12: enter_function: entry to ‘passthru’
nvme-cli-2.13/redhat-linux-build/../nvme.c:9103:15: call_function: calling ‘parse_and_open’ from ‘passthru’
nvme-cli-2.13/redhat-linux-build/../nvme.c:9103:15: return_function: returning to ‘passthru’ from ‘parse_and_open’
nvme-cli-2.13/redhat-linux-build/../nvme.c:9104:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9107:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9108:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9113:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9113:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9119:12: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9119:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9125:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9125:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9133:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9141:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9142:25: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9143:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9146:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9146:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9147:29: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9147:29: danger: ‘mfd’ could be invalid
# 9145|   
# 9146|   		if (cfg.write) {
# 9147|-> 			if (read(mfd, mdata, cfg.metadata_len) < 0) {
# 9148|   				err = -errno;
# 9149|   				nvme_show_perror("failed to read metadata write buffer");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
nvme-cli-2.13/redhat-linux-build/../nvme.c:9558:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(keyfile, "a")’
nvme-cli-2.13/redhat-linux-build/../nvme.c:9523:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9529:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9530:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9536:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9536:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9541:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9542:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9548:24: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9550:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9556:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9558:14: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9558:14: danger: ‘fopen(keyfile, "a")’ leaks here; was opened at [(11)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/10)
# 9556|   	old_umask = umask(0);
# 9557|   
# 9558|-> 	fd = fopen(keyfile, "a");
# 9559|   	if (!fd) {
# 9560|   		nvme_show_error("Failed to open '%s', %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
nvme-cli-2.13/redhat-linux-build/../nvme.c:9558:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(keyfile, "a")’
nvme-cli-2.13/redhat-linux-build/../nvme.c:9523:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9529:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9530:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9536:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9536:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9541:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9542:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9548:24: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9550:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:9556:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9558:14: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../nvme.c:9558:14: danger: ‘fopen(keyfile, "a")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/10)
# 9556|   	old_umask = umask(0);
# 9557|   
# 9558|-> 	fd = fopen(keyfile, "a");
# 9559|   	if (!fd) {
# 9560|   		nvme_show_error("Failed to open '%s', %s",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def52]
nvme-cli-2.13/redhat-linux-build/../nvme.h:98:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
nvme-cli-2.13/redhat-linux-build/../nvme.c:7599:12: enter_function: entry to ‘flush_cmd’
nvme-cli-2.13/redhat-linux-build/../nvme.c:7607:45: release_memory: ‘dev’ is NULL
nvme-cli-2.13/redhat-linux-build/../nvme.c:7621:15: call_function: calling ‘parse_and_open’ from ‘flush_cmd’
nvme-cli-2.13/redhat-linux-build/../nvme.c:7621:15: return_function: returning to ‘flush_cmd’ from ‘parse_and_open’
nvme-cli-2.13/redhat-linux-build/../nvme.c:7622:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:7625:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:7625:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:7626:23: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:7626:23: release_memory: ‘dev’ is NULL
nvme-cli-2.13/redhat-linux-build/../nvme.c:7626:23: call_function: inlined call to ‘__dev_fd’ from ‘flush_cmd’
#   96|   static inline int __dev_fd(struct nvme_dev *dev, const char *func, int line)
#   97|   {
#   98|-> 	if (dev->type != NVME_DEV_DIRECT) {
#   99|   		fprintf(stderr,
#  100|   			"warning: %s:%d not a direct transport!\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
nvme-cli-2.13/redhat-linux-build/../nvme.h:127:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6860:12: enter_function: entry to ‘dir_send’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6912:15: call_function: calling ‘parse_and_open’ from ‘dir_send’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6912:15: return_function: returning to ‘dir_send’ from ‘parse_and_open’
nvme-cli-2.13/redhat-linux-build/../nvme.c:6913:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6916:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6932:17: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6946:13: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6946:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6947:23: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6948:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6953:28: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6953:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../nvme.c:6954:31: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6954:31: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6871:26: call_function: inlined call to ‘cleanup_fd’ from ‘dir_send’
 branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6867:45: call_function: inlined call to ‘cleanup_nvme_dev’ from ‘dir_send’
 branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../nvme.c:6867:45: call_function: inlined call to ‘cleanup_nvme_dev’ from ‘dir_send’
#  125|   void dev_close(struct nvme_dev *dev);
#  126|   
#  127|-> static inline DEFINE_CLEANUP_FUNC(
#  128|   	cleanup_nvme_dev, struct nvme_dev *, dev_close)
#  129|   #define _cleanup_nvme_dev_ __cleanup__(cleanup_nvme_dev)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
nvme-cli-2.13/redhat-linux-build/../nvme.h:127:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:421:12: enter_function: entry to ‘lm_migration_recv’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:503:22: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:514:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:532:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:534:18: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:535:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:438:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_recv’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:437:45: call_function: inlined call to ‘cleanup_nvme_dev’ from ‘lm_migration_recv’
#  125|   void dev_close(struct nvme_dev *dev);
#  126|   
#  127|-> static inline DEFINE_CLEANUP_FUNC(
#  128|   	cleanup_nvme_dev, struct nvme_dev *, dev_close)
#  129|   #define _cleanup_nvme_dev_ __cleanup__(cleanup_nvme_dev)

Error: GCC_ANALYZER_WARNING (CWE-126): [#def55]
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:96:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:293:12: enter_function: entry to ‘huawei_list’
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:317:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:320:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:321:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:324:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:325:12: branch_false: following ‘false’ branch (when ‘n != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:328:22: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:329:12: branch_false: following ‘false’ branch (when ‘list_items’ is non-NULL)...
 branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:335:21: branch_true: following ‘true’ branch (when ‘i < n’)...
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:338:64: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:345:59: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/huawei/huawei-nvme.c:345:23: call_function: calling ‘huawei_get_nvme_info’ from ‘huawei_list’
#   94|   		return err;
#   95|   
#   96|-> 	strncpy(item->node, node, sizeof(item->node));
#   97|   	item->node[sizeof(item->node) - 1] = '\0';
#   98|   	item->block = S_ISBLK(nvme_stat_info.st_mode);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def56]
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:135:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:175:12: enter_function: entry to ‘innogrit_geteventlog’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:192:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:195:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:195:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:198:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:205:14: acquire_memory: this call could return NULL
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:206:9: call_function: calling ‘getvsctype’ from ‘innogrit_geteventlog’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:206:9: return_function: returning to ‘innogrit_geteventlog’ from ‘getvsctype’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:208:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:209:23: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:209:23: call_function: calling ‘getvsc_eventlog’ from ‘innogrit_geteventlog’
#  133|   			printf("get eventlog by vsc command\n");
#  134|   			start_flag = 1;
#  135|-> 			fwrite(data, 1, 4096, fp);
#  136|   			rxlen += 4096;
#  137|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def57]
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:169:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:175:12: enter_function: entry to ‘innogrit_geteventlog’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:192:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:195:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:195:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:198:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:205:14: acquire_memory: this call could return NULL
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:206:9: call_function: calling ‘getvsctype’ from ‘innogrit_geteventlog’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:206:9: return_function: returning to ‘innogrit_geteventlog’ from ‘getvsctype’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:207:15: call_function: calling ‘getlogpage_eventlog’ from ‘innogrit_geteventlog’
#  167|   			return IG_ERROR;
#  168|   		}
#  169|-> 		fwrite(data, 1, 4096, fp);
#  170|   	}
#  171|   	printf("\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:241:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:280:38: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:303:12: branch_true: following ‘true’ branch (when ‘itotal == 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:304:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:241:24: danger: ‘fp’ leaks here; was opened at [(17)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/16)
#  239|   	ret = parse_and_open(&dev, argc, argv, desc, opts);
#  240|   	if (ret)
#  241|-> 		return ret;
#  242|   
#  243|   	ivsctype = getvsctype(dev);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:241:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:280:38: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:303:12: branch_true: following ‘true’ branch (when ‘itotal == 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:304:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:241:24: danger: ‘fp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/16)
#  239|   	ret = parse_and_open(&dev, argc, argv, desc, opts);
#  240|   	if (ret)
#  241|-> 		return ret;
#  242|   
#  243|   	ivsctype = getvsctype(dev);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def60]
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:311:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:280:38: acquire_memory: this call could return NULL
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:303:12: branch_false: following ‘false’ branch (when ‘itotal != 0’)...
 branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:308:16: branch_true: following ‘true’ branch (when ‘ipackcount > ipackindex’)...
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:309:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/innogrit/innogrit-nvme.c:311:17: danger: argument 4 (‘fp’) from [(17)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/16) could be NULL where non-null expected
#  309|   		memset(data, 0, 4096);
#  310|   		strcpy((char *)data, "cdumpstart");
#  311|-> 		fwrite(data, 1, strlen((char *)data), fp);
#  312|   		for (icur = 0; icur < itotal; icur += 4096) {
#  313|   			memset(data, 0, 4096);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def61]
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1424:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘intel’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1350:38: acquire_memory: this call could return NULL
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/intel/intel-nvme.c:1424:9: danger: argument 1 (‘intel’) from [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1) could be NULL where non-null expected
#argument 1 of ‘__builtin_memcpy’ must be non-null
# 1422|   	if (err)
# 1423|   		goto out;
# 1424|-> 	memcpy(intel, buf, sizeof(*intel));
# 1425|   
# 1426|   	/* for 1.1 Fultondales will use old nlog, but current assert/event */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:373:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(cfg.input, "r")’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:348:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:354:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:373:24: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:373:24: danger: ‘fopen(cfg.input, "r")’ leaks here; was opened at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  371|   
#  372|   	if (cfg.input && strlen(cfg.input)) {
#  373|-> 		file = fopen(cfg.input, "r");
#  374|   		if (file == NULL) {
#  375|   			nvme_show_perror(cfg.input);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:373:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(cfg.input, "r")’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:348:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:354:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:373:24: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:373:24: danger: ‘fopen(cfg.input, "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  371|   
#  372|   	if (cfg.input && strlen(cfg.input)) {
#  373|-> 		file = fopen(cfg.input, "r");
#  374|   		if (file == NULL) {
#  375|   			nvme_show_perror(cfg.input);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def64]
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:503:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(cfg.output, "w")’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:503:22: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:503:22: danger: ‘fopen(cfg.output, "w")’ leaks here; was opened at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  501|   
#  502|   	if (cfg.output && strlen(cfg.output)) {
#  503|-> 		fd = fopen(cfg.output, "w");
#  504|   		if (fd < 0) {
#  505|   			nvme_show_perror(cfg.output);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:503:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(cfg.output, "w")’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:503:22: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:503:22: danger: ‘fopen(cfg.output, "w")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#  501|   
#  502|   	if (cfg.output && strlen(cfg.output)) {
#  503|-> 		fd = fopen(cfg.output, "w");
#  504|   		if (fd < 0) {
#  505|   			nvme_show_perror(cfg.output);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:540:29: warning[-Wanalyzer-null-argument]: use of NULL ‘fd’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:514:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:532:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:534:18: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:535:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:540:29: danger: argument 4 (‘fd’) NULL where non-null expected
#  538|   
#  539|   		if (cfg.output && strlen(cfg.output)) {
#  540|-> 			if (fwrite(data, 1, cfg.numd << 2, fd) != (cfg.numd << 2)) {
#  541|   				nvme_show_error("ERROR: %s: failed to write buffer to output file",
#  542|   						strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def67]
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:540:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fd’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:488:38: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:494:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:503:22: acquire_memory: this call could return NULL
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:514:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:532:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:534:18: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:535:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:540:29: danger: argument 4 (‘fd’) from [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6) could be NULL where non-null expected
#  538|   
#  539|   		if (cfg.output && strlen(cfg.output)) {
#  540|-> 			if (fwrite(data, 1, cfg.numd << 2, fd) != (cfg.numd << 2)) {
#  541|   				nvme_show_error("ERROR: %s: failed to write buffer to output file",
#  542|   						strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-404): [#def68]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:393:32: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:578:12: enter_function: entry to ‘mb_set_high_latency_log’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:609:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:612:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:612:13: call_function: calling ‘parse_params’ from ‘mb_set_high_latency_log’
#  391|   			printf("No enough parameters. abort...\n");
#  392|   			va_end(argp);
#  393|-> 			return 1;
#  394|   		}
#  395|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def69]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:655:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("log_c3.csv", "w+")’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:736:12: enter_function: entry to ‘mb_high_latency_log_print’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:750:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:755:9: call_function: calling ‘glp_high_latency_show_bar’ from ‘mb_high_latency_log_print’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:755:9: return_function: returning to ‘mb_high_latency_log_print’ from ‘glp_high_latency_show_bar’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:655:16: danger: ‘fopen("log_c3.csv", "w+")’ leaks here; was opened at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  653|   	fPRINT_PARAM1("Timestamp                        Type    QID    CID    NSID     StartLBA      NumLBA   Latency\n");
#  654|   	fPRINT_PARAM1("---------------------------------------------------------------------------------------------\n");
#  655|-> 	return 0;
#  656|   }
#  657|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:655:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("log_c3.csv", "w+")’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:736:12: enter_function: entry to ‘mb_high_latency_log_print’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:750:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:755:9: call_function: calling ‘glp_high_latency_show_bar’ from ‘mb_high_latency_log_print’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:755:9: return_function: returning to ‘mb_high_latency_log_print’ from ‘glp_high_latency_show_bar’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:655:16: danger: ‘fopen("log_c3.csv", "w+")’ leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
#  653|   	fPRINT_PARAM1("Timestamp                        Type    QID    CID    NSID     StartLBA      NumLBA   Latency\n");
#  654|   	fPRINT_PARAM1("---------------------------------------------------------------------------------------------\n");
#  655|-> 	return 0;
#  656|   }
#  657|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def71]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("log_c3.csv", "w+")’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:750:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: danger: ‘fopen("log_c3.csv", "w+")’ leaks here; was opened at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  751|   		return err;
#  752|   
#  753|-> 	fdi = fopen(FID_C3_LOG_FILENAME, "w+");
#  754|   
#  755|   	glp_high_latency_show_bar(fdi, DO_PRINT_FLAG);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("log_c3.csv", "w+")’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:750:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: danger: ‘fopen("log_c3.csv", "w+")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  751|   		return err;
#  752|   
#  753|-> 	fdi = fopen(FID_C3_LOG_FILENAME, "w+");
#  754|   
#  755|   	glp_high_latency_show_bar(fdi, DO_PRINT_FLAG);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def73]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:756:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("log_c3.csv", "w+")’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:736:12: enter_function: entry to ‘mb_high_latency_log_print’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:750:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:755:9: call_function: calling ‘glp_high_latency_show_bar’ from ‘mb_high_latency_log_print’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:755:9: return_function: returning to ‘mb_high_latency_log_print’ from ‘glp_high_latency_show_bar’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:756:15: call_function: inlined call to ‘__dev_fd’ from ‘mb_high_latency_log_print’
 branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:756:15: danger: ‘fopen("log_c3.csv", "w+")’ leaks here; was opened at [(4)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/3)
#  754|   
#  755|   	glp_high_latency_show_bar(fdi, DO_PRINT_FLAG);
#  756|-> 	err = nvme_get_log_simple(dev_fd(dev), GLP_ID_VU_GET_HIGH_LATENCY_LOG, sizeof(buf), &buf);
#  757|   
#  758|   	while (1) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:756:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("log_c3.csv", "w+")’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:736:12: enter_function: entry to ‘mb_high_latency_log_print’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:750:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:753:15: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:755:9: call_function: calling ‘glp_high_latency_show_bar’ from ‘mb_high_latency_log_print’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:755:9: return_function: returning to ‘mb_high_latency_log_print’ from ‘glp_high_latency_show_bar’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:756:15: call_function: inlined call to ‘__dev_fd’ from ‘mb_high_latency_log_print’
 branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:756:15: danger: ‘fopen("log_c3.csv", "w+")’ leaks here; was allocated at [(4)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/3)
#  754|   
#  755|   	glp_high_latency_show_bar(fdi, DO_PRINT_FLAG);
#  756|-> 	err = nvme_get_log_simple(dev_fd(dev), GLP_ID_VU_GET_HIGH_LATENCY_LOG, sizeof(buf), &buf);
#  757|   
#  758|   	while (1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def75]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:844:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cfg.fw, 0)’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:820:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:823:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:823:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:829:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:830:33: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:829:21: branch_false: following ‘false’ branch (when ‘i == 3’)...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:832:22: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:844:17: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:844:17: danger: ‘open(cfg.fw, 0)’ leaks here; was opened at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
#  842|   	}
#  843|   
#  844|-> 	fw_fd = open(cfg.fw, O_RDONLY);
#  845|   	if (fw_fd < 0) {
#  846|   		fprintf(stderr, "no firmware file provided\n");

Error: GCC_ANALYZER_WARNING (CWE-688): [#def76]
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:929:9: warning[-Wanalyzer-null-argument]: use of NULL ‘fd’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:934:5: enter_function: entry to ‘io_latency_histogram’
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:936:21: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:945:9: release_memory: assuming ‘fopen(file, "w+")’ is NULL
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:945:9: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:945:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:946:9: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:946:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:949:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:950:17: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:950:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:951:17: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:951:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:952:17: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:952:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:956:29: branch_true: following ‘true’ branch (when ‘i != 32’)...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:957:28: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:957:28: branch_false: following ‘false’ branch (when ‘i != 31’)...
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:962:78: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/memblaze/memblaze-nvme.c:962:33: call_function: calling ‘ioLatencyHistogramOutput’ from ‘io_latency_histogram’
#  927|   	len = snprintf(string, sizeof(string), "%-11d %-11s %-11s %-11u\n",
#  928|   		       index, subString0, subString1, pHistogram[index]);
#  929|-> 	fwrite(string, 1, len, fd);
#  930|   	if (print)
#  931|   		printf("%s", string);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def77]
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:1668:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*strOSDirName’
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:2962:12: enter_function: entry to ‘micron_internal_logs’
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3061:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3065:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3078:19: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3083:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3083:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3092:24: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3095:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3100:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3101:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3105:12: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3105:12: branch_false: following ‘false’ branch (when ‘telemetry_option == 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3122:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3127:21: branch_true: following ‘true’ branch (when ‘i != 20’)...
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3128:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3128:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3128:20: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3135:9: call_function: calling ‘SetupDebugDataDirectories’ from ‘micron_internal_logs’
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3135:9: return_function: returning to ‘micron_internal_logs’ from ‘SetupDebugDataDirectories’
nvme-cli-2.13/redhat-linux-build/../plugins/micron/micron-nvme.c:3137:9: call_function: calling ‘GetTimestampInfo’ from ‘micron_internal_logs’
# 1666|   	num += sprintf((char *)(outstr + num), "\nPackage Version: 1.4");
# 1667|   	if (num) {
# 1668|-> 		strPDir = strdup(strOSDirName);
# 1669|   		strDest = dirname(strPDir);
# 1670|   		WriteData(outstr, num, strDest, "timestamp_info.txt", "timestamp");

Error: GCC_ANALYZER_WARNING: [#def78]
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-hardware-component-log.c:219:21: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-hardware-component-log.c:193:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-hardware-component-log.c:199:33: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-hardware-component-log.c:210:12: branch_false: following ‘false’ branch (when ‘log_bytes > 6.4e+1l’)...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-hardware-component-log.c:215:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-hardware-component-log.c:219:21: danger: at least one operand of the size argument is of a floating-point type
#  217|   	print_info("args.len: %u\n", args.len);
#  218|   
#  219|-> 	log->desc = calloc(1, args.len);
#  220|   	if (!log->desc) {
#  221|   		fprintf(stderr, "error: ocp: calloc: %s\n", strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def79]
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2734:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cfg.file, 0)’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2728:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2733:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2733:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2734:23: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2734:23: danger: ‘open(*cfg.file, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 2732|   
# 2733|   	if (cfg->file && strlen(cfg->file)) {
# 2734|-> 		ffd = open(cfg->file, O_RDONLY);
# 2735|   		if (ffd < 0) {
# 2736|   			nvme_show_error("Failed to open file %s: %s", cfg->file, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def80]
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:475:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘description_str’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:870:6: enter_function: entry to ‘parse_common_event’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:889:20: branch_true: following ‘true’ branch (when ‘pevent_fifos_object’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:890:25: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:890:25: call_function: calling ‘json_add_formatted_u32_str’ from ‘parse_common_event’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:890:25: return_function: returning to ‘parse_common_event’ from ‘json_add_formatted_u32_str’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:892:25: call_function: calling ‘json_object_add_value_string’ from ‘parse_common_event’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:892:25: return_function: returning to ‘parse_common_event’ from ‘json_object_add_value_string’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:894:25: call_function: calling ‘json_add_formatted_var_size_str’ from ‘parse_common_event’
#argument 1 of ‘__builtin_strcat’ must be non-null
#  473|   	for (size_t i = 0; i < data_size; ++i) {
#  474|   		sprintf(temp_buffer, "%02X", pdata[i]);
#  475|-> 		strcat(description_str, temp_buffer);
#  476|   	}
#  477|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def81]
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:989:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘description’ where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:1705:5: enter_function: entry to ‘print_ocp_telemetry_json’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:1770:18: call_function: calling ‘parse_statistics’ from ‘print_ocp_telemetry_json’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:1770:18: return_function: returning to ‘print_ocp_telemetry_json’ from ‘parse_statistics’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:1771:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:1777:18: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-telemetry-decode.c:1777:18: call_function: calling ‘parse_event_fifos’ from ‘print_ocp_telemetry_json’
#argument 1 of ‘__builtin_memset’ must be non-null
#  987|   	char *description = (char *)malloc((40 + 1) * sizeof(char));
#  988|   
#  989|-> 	memset(description, 0, sizeof(40));
#  990|   
#  991|   	status =

Error: GCC_ANALYZER_WARNING (CWE-775): [#def82]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1152:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1285:28: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1350:23: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1152:17: danger: ‘fopen(file, "rb")’ leaks here; was opened at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
# 1150|   	fd = fopen(output, "w+");
# 1151|   	if (!fd) {
# 1152|-> 		fprintf(stderr, "Failed to open %s file to write\n", output);
# 1153|   		err = ENOENT;
# 1154|   		goto ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1152:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1285:28: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1350:23: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1152:17: danger: ‘fopen(file, "rb")’ leaks here; was allocated at [(17)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/16)
# 1150|   	fd = fopen(output, "w+");
# 1151|   	if (!fd) {
# 1152|-> 		fprintf(stderr, "Failed to open %s file to write\n", output);
# 1153|   		err = ENOENT;
# 1154|   		goto ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def84]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1158:55: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1221:12: enter_function: entry to ‘nvme_dump_evtlog’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1285:28: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1312:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1317:41: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1317:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1322:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1350:23: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1350:23: call_function: calling ‘nvme_parse_evtlog’ from ‘nvme_dump_evtlog’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1350:23: return_function: returning to ‘nvme_dump_evtlog’ from ‘nvme_parse_evtlog’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1158:55: danger: ‘fopen(file, "rb")’ leaks here; was opened at [(22)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/21)
# 1156|   
# 1157|   	while (length > 0) {
# 1158|-> 		info = (struct sfx_nvme_evtlog_info *)(pevent_log_info + offset);
# 1159|   
# 1160|   		if ((info->magic1 == 0x474F4C545645) &&

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1158:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1221:12: enter_function: entry to ‘nvme_dump_evtlog’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1285:28: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1312:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1317:41: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1317:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1322:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1350:23: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1350:23: call_function: calling ‘nvme_parse_evtlog’ from ‘nvme_dump_evtlog’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1350:23: return_function: returning to ‘nvme_dump_evtlog’ from ‘nvme_parse_evtlog’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1158:55: danger: ‘fopen(file, "rb")’ leaks here; was allocated at [(22)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/21)
# 1156|   
# 1157|   	while (length > 0) {
# 1158|-> 		info = (struct sfx_nvme_evtlog_info *)(pevent_log_info + offset);
# 1159|   
# 1160|   		if ((info->magic1 == 0x474F4C545645) &&

Error: GCC_ANALYZER_WARNING (CWE-775): [#def86]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10)
# 1291|   	}
# 1292|   
# 1293|-> 	fd = fopen(file, "wb+");
# 1294|   	if (!fd) {
# 1295|   		fprintf(stderr, "Failed to open %s file to write\n", file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10)
# 1291|   	}
# 1292|   
# 1293|-> 	fd = fopen(file, "wb+");
# 1294|   	if (!fd) {
# 1295|   		fprintf(stderr, "Failed to open %s file to write\n", file);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def88]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1304:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1303:16: branch_true: following ‘true’ branch (when ‘length != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1304:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1304:17: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/10)
# 1302|   	length = log_len;
# 1303|   	while (length > 0) {
# 1304|-> 		args.lpo = offset;
# 1305|   		if (length > single_len) {
# 1306|   			args.len = single_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1304:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1303:16: branch_true: following ‘true’ branch (when ‘length != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1304:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1304:17: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/10)
# 1302|   	length = log_len;
# 1303|   	while (length > 0) {
# 1304|-> 		args.lpo = offset;
# 1305|   		if (length > single_len) {
# 1306|   			args.len = single_len;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def90]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1327:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1303:16: branch_false: following ‘false’ branch (when ‘length == 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1327:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1327:9: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/10)
# 1325|   	}
# 1326|   
# 1327|-> 	printf("\nDump-evtlog: Success\n");
# 1328|   
# 1329|   	if (parse) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1327:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1303:16: branch_false: following ‘false’ branch (when ‘length == 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1327:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1327:9: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/10)
# 1325|   	}
# 1326|   
# 1327|-> 	printf("\nDump-evtlog: Success\n");
# 1328|   
# 1329|   	if (parse) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def92]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/10)
# 1328|   
# 1329|   	if (parse) {
# 1330|-> 		nvme_free_huge(&mh);
# 1331|   		pevent_log_info = nvme_alloc_huge(log_len, &mh);
# 1332|   		if (!pevent_log_info) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/10)
# 1328|   
# 1329|   	if (parse) {
# 1330|-> 		nvme_free_huge(&mh);
# 1331|   		pevent_log_info = nvme_alloc_huge(log_len, &mh);
# 1332|   		if (!pevent_log_info) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def94]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1331:35: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1331:35: danger: ‘fopen(file, "wb+")’ leaks here; was opened at [(11)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/10)
# 1329|   	if (parse) {
# 1330|   		nvme_free_huge(&mh);
# 1331|-> 		pevent_log_info = nvme_alloc_huge(log_len, &mh);
# 1332|   		if (!pevent_log_info) {
# 1333|   			fprintf(stderr, "Failed to alloc enough memory 0x%x to parse evtlog\n", log_len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1331:35: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "wb+")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1331:35: danger: ‘fopen(file, "wb+")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/10)
# 1329|   	if (parse) {
# 1330|   		nvme_free_huge(&mh);
# 1331|-> 		pevent_log_info = nvme_alloc_huge(log_len, &mh);
# 1332|   		if (!pevent_log_info) {
# 1333|   			fprintf(stderr, "Failed to alloc enough memory 0x%x to parse evtlog\n", log_len);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def96]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: danger: ‘fopen(file, "rb")’ leaks here; was opened at [(17)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/16)
# 1337|   
# 1338|   		fclose(fd);
# 1339|-> 		fd = fopen(file, "rb");
# 1340|   		if (!fd) {
# 1341|   			fprintf(stderr, "Failed to open %s file to read\n", file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: danger: ‘fopen(file, "rb")’ leaks here; was allocated at [(17)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/16)
# 1337|   
# 1338|   		fclose(fd);
# 1339|-> 		fd = fopen(file, "rb");
# 1340|   		if (!fd) {
# 1341|   			fprintf(stderr, "Failed to open %s file to read\n", file);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def98]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: danger: ‘fopen(file, "rb")’ leaks here; was opened at [(17)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/16)
# 1343|   			goto free_pevent;
# 1344|   		}
# 1345|-> 		if (fread(pevent_log_info, 1, log_len, fd) != log_len) {
# 1346|   			fprintf(stderr, "Failed to read evtlog to buffer\n");
# 1347|   			goto close_fd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1284:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1287:27: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: danger: ‘fopen(file, "rb")’ leaks here; was allocated at [(17)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/16)
# 1343|   			goto free_pevent;
# 1344|   		}
# 1345|-> 		if (fread(pevent_log_info, 1, log_len, fd) != log_len) {
# 1346|   			fprintf(stderr, "Failed to read evtlog to buffer\n");
# 1347|   			goto close_fd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1346:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1346:25: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1346:25: danger: ‘fopen(file, "rb")’ leaks here; was opened at [(15)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/14)
# 1344|   		}
# 1345|   		if (fread(pevent_log_info, 1, log_len, fd) != log_len) {
# 1346|-> 			fprintf(stderr, "Failed to read evtlog to buffer\n");
# 1347|   			goto close_fd;
# 1348|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1346:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "rb")’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1261:12: branch_false: following ‘false’ branch (when ‘pevent’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1266:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1271:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1276:20: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1278:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1283:31: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1288:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1293:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1294:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1300:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1329:12: branch_true: following ‘true’ branch (when ‘parse != 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1330:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1332:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1338:17: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1339:22: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1340:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1345:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1346:25: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1346:25: danger: ‘fopen(file, "rb")’ leaks here; was allocated at [(15)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/14)
# 1344|   		}
# 1345|   		if (fread(pevent_log_info, 1, log_len, fd) != log_len) {
# 1346|-> 			fprintf(stderr, "Failed to read evtlog to buffer\n");
# 1347|   			goto close_fd;
# 1348|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1788:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1751:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1750:32: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1750:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1756:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1764:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1770:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1780:14: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1781:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1787:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1788:12: danger: ‘open(&path, 0)’ leaks here; was opened at [(47)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/46)
# 1786|   
# 1787|   	len = read(fd, path, 512);
# 1788|-> 	if (len < 1) {
# 1789|   		perror("Could not read PCIe AER Non-Fatal errors in /sys/");
# 1790|   		err = errno;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def103]
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1820:17: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘open(&path, 0)’
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1597:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1601:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1620:23: branch_true: following ‘true’ branch (when ‘len != 8’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1621:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1628:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1633:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1635:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1641:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1645:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1650:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1652:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1658:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1672:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1677:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1679:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1685:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1689:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1694:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1696:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1702:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1704:23: branch_true: following ‘true’ branch (when ‘len != 18’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1704:50: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1711:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1716:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1718:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1724:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1726:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1727:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1727:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1726:35: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1726:23: branch_false: following ‘false’ branch (when ‘len == 5’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1731:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1735:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1740:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1742:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1748:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1750:23: branch_true: following ‘true’ branch (when ‘len != 5’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1751:21: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1758:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1763:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1764:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1770:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1781:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1787:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1788:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1793:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1795:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1801:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1802:14: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1803:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1809:15: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1810:12: branch_false: following ‘false’ branch (when ‘len > 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1816:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1816:9: release_resource: first ‘close’ here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1818:12: branch_true: following ‘true’ branch (when ‘len <= 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1819:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/scaleflux/sfx-nvme.c:1820:17: danger: second ‘close’ here; first ‘close’ was at [(55)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/54)
# 1818|   	if (len < 1) {
# 1819|   		perror("Could not parse PCIe AER Fatal errors in /sys/");
# 1820|-> 		close(fd);
# 1821|   		err = -1;
# 1822|   		goto close_dev;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def104]
nvme-cli-2.13/redhat-linux-build/../plugins/sed/sedopal_cmd.c:185:29: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
nvme-cli-2.13/redhat-linux-build/../plugins/sed/sedopal_cmd.c:506:5: enter_function: entry to ‘sedopal_cmd_password’
nvme-cli-2.13/redhat-linux-build/../plugins/sed/sedopal_cmd.c:521:13: call_function: calling ‘sedopal_set_key’ from ‘sedopal_cmd_password’
#  183|   		if (sedopal_ask_new_key) {
#  184|   			pass = sedopal_get_password(SEDOPAL_REENTER_PW_PROMPT);
#  185|-> 			if (strncmp((char *)key->key, pass, key->key_len)) {
#  186|   				fprintf(stderr,
#  187|   					"Error: passwords don't match\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def105]
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:309:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:308:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:311:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:311:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:317:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:317:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:318:21: branch_true: ...to here
 branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:323:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:327:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:328:31: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:328:31: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:329:28: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:335:46: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:336:20: branch_true: following ‘true’ branch (when ‘err < 0’)...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:337:25: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:370:12: branch_true: following ‘true’ branch (when ‘buf’ is non-NULL)...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:371:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:309:24: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  307|   	err = parse_and_open(&dev, argc, argv, desc, opts);
#  308|   	if (err)
#  309|-> 		return err;
#  310|   
#  311|   	if (!cfg.feature_id) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def106]
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:329:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cfg.file, 0)’
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:308:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:311:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:311:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:317:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:317:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:318:21: branch_true: ...to here
 branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:323:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:327:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:328:31: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:328:31: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:329:28: danger: ‘open(cfg.file, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  327|   		if (strlen(cfg.file)) {
#  328|   			ffd = open(cfg.file, O_RDONLY);
#  329|-> 			if (ffd <= 0) {
#  330|   				fprintf(stderr, "no firmware file provided\n");
#  331|   				err = EINVAL;

Error: GCC_ANALYZER_WARNING: [#def107]
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:335:23: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘ffd’
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:308:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:311:14: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:311:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:317:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:317:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:318:21: branch_true: ...to here
 branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:323:17: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:327:20: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:328:31: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:328:31: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:329:28: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:335:46: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/shannon/shannon-nvme.c:335:23: danger: ‘ffd’ could be invalid: unchecked value from [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  333|   			}
#  334|   		}
#  335|-> 		err = read(ffd, (void *)buf, cfg.data_len);
#  336|   		if (err < 0) {
#  337|   			fprintf(stderr, "failed to read data buffer from input file\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
nvme-cli-2.13/redhat-linux-build/../plugins/solidigm/solidigm-internal-logs.c:882:15: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(cfg.out_dir)’
nvme-cli-2.13/redhat-linux-build/../plugins/solidigm/solidigm-internal-logs.c:857:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/solidigm/solidigm-internal-logs.c:859:9: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/solidigm/solidigm-internal-logs.c:862:34: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/solidigm/solidigm-internal-logs.c:865:21: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/solidigm/solidigm-internal-logs.c:882:15: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/solidigm/solidigm-internal-logs.c:882:15: danger: ‘opendir(cfg.out_dir)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  880|   	}
#  881|   
#  882|-> 	dir = opendir(cfg.out_dir);
#  883|   	if (dir)
#  884|   		closedir(dir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def109]
nvme-cli-2.13/redhat-linux-build/../util/cleanup.h:34:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2700:12: enter_function: entry to ‘error_injection_set’
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2728:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2733:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2733:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2734:23: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2735:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2739:40: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2714:26: call_function: inlined call to ‘cleanup_fd’ from ‘error_injection_set’
 branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/ocp/ocp-nvme.c:2714:26: call_function: inlined call to ‘cleanup_fd’ from ‘error_injection_set’
#   32|   static inline void cleanup_fd(int *fd)
#   33|   {
#   34|-> 	if (*fd > STDERR_FILENO)
#   35|   		close(*fd);
#   36|   }

Error: GCC_ANALYZER_WARNING (CWE-910): [#def110]
nvme-cli-2.13/redhat-linux-build/../util/cleanup.h:55:15: warning[-Wanalyzer-double-fclose]: double ‘fclose’ of FILE ‘file’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:269:12: enter_function: entry to ‘lm_migration_send’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:348:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:354:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:373:24: acquire_resource: opened here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:374:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:379:40: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:380:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:383:48: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:385:17: release_resource: first ‘fclose’ here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:296:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_send’
#   53|   #define _cleanup_uri_ __cleanup__(free_uri)
#   54|   
#   55|-> static inline DEFINE_CLEANUP_FUNC(cleanup_file, FILE *, fclose)
#   56|   #define _cleanup_file_ __cleanup__(cleanup_file)
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def111]
nvme-cli-2.13/redhat-linux-build/../util/cleanup.h:55:15: warning[-Wanalyzer-double-free]: double-‘fclose’ of ‘file’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:269:12: enter_function: entry to ‘lm_migration_send’
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:348:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:354:13: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:373:24: acquire_memory: allocated here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:374:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:379:40: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:380:20: branch_false: following ‘false’ branch...
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:383:48: branch_false: ...to here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:385:17: release_memory: first ‘fclose’ here
nvme-cli-2.13/redhat-linux-build/../plugins/lm/lm-nvme.c:296:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_send’
#   53|   #define _cleanup_uri_ __cleanup__(free_uri)
#   54|   
#   55|-> static inline DEFINE_CLEANUP_FUNC(cleanup_file, FILE *, fclose)
#   56|   #define _cleanup_file_ __cleanup__(cleanup_file)
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def112]
nvme-cli-2.13/redhat-linux-build/../util/utils.c:56:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘text’
nvme-cli-2.13/redhat-linux-build/../util/utils.c:179:6: enter_function: entry to ‘process_field_size_8’
nvme-cli-2.13/redhat-linux-build/../util/utils.c:189:19: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../util/utils.c:190:22: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../util/utils.c:195:17: call_function: calling ‘hex_to_ascii’ from ‘process_field_size_8’
#   54|   				int dec = hex_to_int(hex[0]);
#   55|   
#   56|-> 				text[0] = dec;
#   57|   			}
#   58|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
nvme-cli-2.13/redhat-linux-build/../util/utils.c:208:1: warning[-Wanalyzer-malloc-leak]: leak of ‘hex_to_ascii(&buffer)’
nvme-cli-2.13/redhat-linux-build/../util/utils.c:179:6: enter_function: entry to ‘process_field_size_8’
nvme-cli-2.13/redhat-linux-build/../util/utils.c:189:19: branch_true: following ‘true’ branch...
nvme-cli-2.13/redhat-linux-build/../util/utils.c:190:22: branch_true: ...to here
nvme-cli-2.13/redhat-linux-build/../util/utils.c:195:17: call_function: calling ‘hex_to_ascii’ from ‘process_field_size_8’
nvme-cli-2.13/redhat-linux-build/../util/utils.c:195:17: return_function: returning to ‘process_field_size_8’ from ‘hex_to_ascii’
nvme-cli-2.13/redhat-linux-build/../util/utils.c:208:1: danger: ‘hex_to_ascii(&buffer)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  206|   		sprintf(datastr, "0x%"PRIx64"", le64_to_cpu(lval_lo));
#  207|   	}
#  208|-> }
#  209|   
#  210|   void process_field_size_7(int offset, char *sfield, __u8 *buf, char *datastr)

Error: CPPCHECK_WARNING (CWE-476): [#def114]
nvme-cli-2.13/util/utils.c:60: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: text
#   58|   		}
#   59|   
#   60|-> 		text[symbol_count] = '\0'; // Terminate the string
#   61|   	}
#   62|   

Error: CPPCHECK_WARNING (CWE-476): [#def115]
nvme-cli-2.13/util/utils.c:149: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: description_str
#  147|   	for (size_t i = 0; i < data_size; ++i) {
#  148|   		sprintf(temp_buffer, "%02X", pdata[i]);
#  149|-> 		strcat(description_str, temp_buffer);
#  150|   	}
#  151|   

Error: CPPCHECK_WARNING (CWE-401): [#def116]
nvme-cli-2.13/util/utils.c:195: error[leakNoVarFunctionCall]: Allocation with hex_to_ascii, sprintf doesn't release it.
#  193|   
#  194|   		sprintf(buffer, "%"PRIx64, __builtin_bswap64(lval_lo));
#  195|-> 		sprintf(datastr, "%s", hex_to_ascii(buffer));
#  196|   	} else if (strstr(sfield, "Timestamp")) {
#  197|   		char ts_buf[128];

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-124.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namenvme-cli-2.13-1.fc43
store-results-to/tmp/tmpc5z_homa/nvme-cli-2.13-1.fc43.tar.xz
time-created2025-04-25 14:35:19
time-finished2025-04-25 14:37:47
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpc5z_homa/nvme-cli-2.13-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpc5z_homa/nvme-cli-2.13-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9