Error: GCC_ANALYZER_WARNING (CWE-401): [#def1] nvme-cli-2.16/nbft.c:61:33: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’ nvme-cli-2.16/nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’ nvme-cli-2.16/nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)... nvme-cli-2.16/nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’ nvme-cli-2.16/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): [#def2] nvme-cli-2.16/nbft.c:62:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘entry’ nvme-cli-2.16/nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’ nvme-cli-2.16/nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)... nvme-cli-2.16/nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’ nvme-cli-2.16/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): [#def3] nvme-cli-2.16/nbft.c:69:1: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’ nvme-cli-2.16/nbft.c:286:5: enter_function: entry to ‘discover_from_nbft’ nvme-cli-2.16/nbft.c:301:12: branch_true: following ‘true’ branch (when ‘connect != 0’)... nvme-cli-2.16/nbft.c:305:9: call_function: inlined call to ‘list_head_init’ from ‘discover_from_nbft’ nvme-cli-2.16/nbft.c:306:15: call_function: calling ‘read_nbft_files’ from ‘discover_from_nbft’ # 67| free(dent); # 68| return 0; # 69|-> } # 70| # 71| void free_nbfts(struct list_head *nbft_list) Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] nvme-cli-2.16/nvme-print-json.c:2162:18: warning[-Wanalyzer-malloc-leak]: leak of ‘printable’ nvme-cli-2.16/nvme-print-json.c:2123:14: enter_function: entry to ‘json_eom_printable_eye’ nvme-cli-2.16/nvme-print-json.c:2133:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-print-json.c:2136:21: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2137:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-print-json.c:2144:28: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2144:21: acquire_memory: allocated here nvme-cli-2.16/nvme-print-json.c:2147:12: branch_false: following ‘false’ branch (when ‘printable’ is non-NULL)... nvme-cli-2.16/nvme-print-json.c:2147:12: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2150:25: branch_true: following ‘true’ branch... nvme-cli-2.16/nvme-print-json.c:2151:36: branch_true: ...to here nvme-cli-2.16/nvme-print-json.c:2153:20: branch_false: following ‘false’ branch (when ‘row’ is non-NULL)... nvme-cli-2.16/nvme-print-json.c:2153:20: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2156:33: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-print-json.c:2162:18: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2165:17: call_function: calling ‘json_array_add_value_string’ from ‘json_eom_printable_eye’ nvme-cli-2.16/nvme-print-json.c:2165:17: return_function: returning to ‘json_eom_printable_eye’ from ‘json_array_add_value_string’ nvme-cli-2.16/nvme-print-json.c:2150:25: branch_true: following ‘true’ branch... nvme-cli-2.16/nvme-print-json.c:2151:36: branch_true: ...to here nvme-cli-2.16/nvme-print-json.c:2153:20: branch_true: following ‘true’ branch (when ‘row’ is NULL)... nvme-cli-2.16/nvme-print-json.c:2154:25: branch_true: ...to here nvme-cli-2.16/nvme-print-json.c:2162:18: danger: ‘printable’ leaks here; was allocated at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5) # 2160| } # 2161| # 2162|-> *printable++ = '\n'; # 2163| row[ncols] = '\0'; # 2164| Error: GCC_ANALYZER_WARNING (CWE-124): [#def5] nvme-cli-2.16/nvme-print-json.c:2244:17: warning[-Wanalyzer-out-of-bounds]: heap-based buffer underwrite nvme-cli-2.16/nvme-print-json.c:2193:21: branch_true: following ‘true’ branch... nvme-cli-2.16/nvme-print-json.c:2202:25: branch_true: ...to here nvme-cli-2.16/nvme-print-json.c:2221:20: branch_true: following ‘true’ branch... nvme-cli-2.16/nvme-print-json.c:2222:39: branch_true: ...to here nvme-cli-2.16/nvme-print-json.c:2224:20: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-print-json.c:2228:33: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2230:20: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-print-json.c:2236:32: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2241:38: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-print-json.c:2244:17: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2244:17: danger: out-of-bounds write at byte -1 but region starts at byte 0 # 2242| hexdata += sprintf(hexdata, "%02X ", vsdata[offset]); # 2243| /* remove trailing space */ # 2244|-> *(hexdata - 1) = '\0'; # 2245| # 2246| obj_add_str(jdesc, "vsdata_hex", hexstr); Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] nvme-cli-2.16/nvme-rpmb.c:91:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rpmb_md5(&num, 4)’ nvme-cli-2.16/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’ nvme-cli-2.16/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:913:15: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:917:34: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:924:13: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’ nvme-cli-2.16/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’ nvme-cli-2.16/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:957:21: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:963:21: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:963:20: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:980:17: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:989:38: call_function: calling ‘rpmb_read_config_block’ from ‘rpmb_cmd_option’ # 89| # 90| /* if algorithm requires key, set it first - empty keys not accepted !*/ # 91|-> if (key != NULL && keylen > 0) { # 92| error = setsockopt(infd, SOL_ALG, ALG_SET_KEY, key, keylen); # 93| if (error < 0) { Error: GCC_ANALYZER_WARNING (CWE-688): [#def7] nvme-cli-2.16/nvme-rpmb.c:968:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘msg_buf’ where non-null expected nvme-cli-2.16/nvme-rpmb.c:840:5: enter_function: entry to ‘rpmb_cmd_option’ nvme-cli-2.16/nvme-rpmb.c:909:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:913:15: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:914:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:917:34: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:918:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:924:13: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:924:12: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:951:27: call_function: calling ‘read_rpmb_key’ from ‘rpmb_cmd_option’ nvme-cli-2.16/nvme-rpmb.c:951:27: return_function: returning to ‘rpmb_cmd_option’ from ‘read_rpmb_key’ nvme-cli-2.16/nvme-rpmb.c:952:20: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:957:21: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:957:20: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-rpmb.c:963:21: branch_false: ...to here nvme-cli-2.16/nvme-rpmb.c:963:20: branch_true: following ‘true’ branch... nvme-cli-2.16/nvme-rpmb.c:965:29: branch_true: ...to here nvme-cli-2.16/nvme-rpmb.c:965:28: branch_true: following ‘true’ branch... nvme-cli-2.16/nvme-rpmb.c:966:44: branch_true: ...to here nvme-cli-2.16/nvme-rpmb.c:967:60: acquire_memory: this call could return NULL nvme-cli-2.16/nvme-rpmb.c:968:33: danger: argument 1 (‘malloc(strlen(cfg.msg) & 4294967295)’) from [(27)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/26) could be NULL where non-null expected # 966| msg_size = strlen(cfg.msg); # 967| msg_buf = (unsigned char *)malloc(msg_size); # 968|-> memcpy(msg_buf, cfg.msg, msg_size); # 969| } else { # 970| err = read_file(cfg.msgfile, &msg_buf, &msg_size); Error: GCC_ANALYZER_WARNING (CWE-775): [#def8] nvme-cli-2.16/plugins/feat/feat-nvme.c:211:40: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’ nvme-cli-2.16/plugins/feat/feat-nvme.c:169:12: enter_function: entry to ‘perfc_set’ nvme-cli-2.16/plugins/feat/feat-nvme.c:200:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/feat/feat-nvme.c:201:31: acquire_resource: opened here nvme-cli-2.16/plugins/feat/feat-nvme.c:202:28: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/feat/feat-nvme.c:207:59: branch_false: ...to here nvme-cli-2.16/plugins/feat/feat-nvme.c:175:26: call_function: inlined call to ‘cleanup_fd’ from ‘perfc_set’ nvme-cli-2.16/plugins/feat/feat-nvme.c:236:1: branch_false: ...to here nvme-cli-2.16/plugins/feat/feat-nvme.c:211:40: danger: ‘ffd’ leaks here; was opened at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5) # 209| nvme_show_error("failed to read data buffer from input file: %s", # 210| strerror(errno)); # 211|-> return -errno; # 212| } # 213| } Error: GCC_ANALYZER_WARNING (CWE-126): [#def9] nvme-cli-2.16/plugins/huawei/huawei-nvme.c:96:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read nvme-cli-2.16/plugins/huawei/huawei-nvme.c:293:12: enter_function: entry to ‘huawei_list’ nvme-cli-2.16/plugins/huawei/huawei-nvme.c:317:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/huawei/huawei-nvme.c:320:38: branch_false: ...to here nvme-cli-2.16/plugins/huawei/huawei-nvme.c:321:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/huawei/huawei-nvme.c:324:13: branch_false: ...to here nvme-cli-2.16/plugins/huawei/huawei-nvme.c:325:12: branch_false: following ‘false’ branch (when ‘n != 0’)... nvme-cli-2.16/plugins/huawei/huawei-nvme.c:328:22: branch_false: ...to here nvme-cli-2.16/plugins/huawei/huawei-nvme.c:329:12: branch_false: following ‘false’ branch (when ‘list_items’ is non-NULL)... nvme-cli-2.16/plugins/huawei/huawei-nvme.c:329:12: branch_false: ...to here nvme-cli-2.16/plugins/huawei/huawei-nvme.c:335:21: branch_true: following ‘true’ branch (when ‘i < n’)... nvme-cli-2.16/plugins/huawei/huawei-nvme.c:338:64: branch_true: ...to here nvme-cli-2.16/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-775): [#def10] nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:36:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:280:38: acquire_resource: opened here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:303:12: branch_true: following ‘true’ branch (when ‘itotal == 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:304:17: branch_true: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:36:16: danger: ‘fp’ leaks here; was opened at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16) # 34| cmd.addr = (__u64)(__u64)(uintptr_t)data; # 35| cmd.data_len = data_len; # 36|-> return nvme_submit_admin_passthru(fd, &cmd, NULL); # 37| } # 38| Error: GCC_ANALYZER_WARNING (CWE-401): [#def11] nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:36:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:280:38: acquire_memory: allocated here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:303:12: branch_true: following ‘true’ branch (when ‘itotal == 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:304:17: branch_true: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:36:16: danger: ‘fp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/16) # 34| cmd.addr = (__u64)(__u64)(uintptr_t)data; # 35| cmd.data_len = data_len; # 36|-> return nvme_submit_admin_passthru(fd, &cmd, NULL); # 37| } # 38| Error: GCC_ANALYZER_WARNING (CWE-688): [#def12] nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:135:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:175:12: enter_function: entry to ‘innogrit_geteventlog’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:192:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:195:13: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:195:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:198:9: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:205:14: acquire_memory: this call could return NULL nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:206:9: call_function: calling ‘getvsctype’ from ‘innogrit_geteventlog’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:206:9: return_function: returning to ‘innogrit_geteventlog’ from ‘getvsctype’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:208:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:209:23: branch_true: ...to here nvme-cli-2.16/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): [#def13] nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:169:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:175:12: enter_function: entry to ‘innogrit_geteventlog’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:192:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:195:13: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:195:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:198:9: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:205:14: acquire_memory: this call could return NULL nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:206:9: call_function: calling ‘getvsctype’ from ‘innogrit_geteventlog’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:206:9: return_function: returning to ‘innogrit_geteventlog’ from ‘getvsctype’ nvme-cli-2.16/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-688): [#def14] nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:311:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:218:12: enter_function: entry to ‘innogrit_vsc_getcdump’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:240:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: call_function: calling ‘getvsctype’ from ‘innogrit_vsc_getcdump’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:243:20: return_function: returning to ‘innogrit_vsc_getcdump’ from ‘getvsctype’ nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:245:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:248:9: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:263:12: branch_true: following ‘true’ branch (when ‘ret == 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:264:17: branch_true: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:265:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:267:25: branch_true: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:268:28: branch_false: following ‘false’ branch (when ‘ipackcount != 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:271:42: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:280:38: acquire_memory: this call could return NULL nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:303:12: branch_false: following ‘false’ branch (when ‘itotal != 0’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:303:12: branch_false: ...to here nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:308:16: branch_true: following ‘true’ branch (when ‘ipackcount > ipackindex’)... nvme-cli-2.16/plugins/innogrit/innogrit-nvme.c:309:17: branch_true: ...to here nvme-cli-2.16/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): [#def15] nvme-cli-2.16/plugins/intel/intel-nvme.c:1424:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘intel’ where non-null expected nvme-cli-2.16/plugins/intel/intel-nvme.c:1342:12: enter_function: entry to ‘get_internal_log’ nvme-cli-2.16/plugins/intel/intel-nvme.c:1350:38: acquire_memory: this call could return NULL nvme-cli-2.16/plugins/intel/intel-nvme.c:1391:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/intel/intel-nvme.c:1396:13: branch_false: ...to here nvme-cli-2.16/plugins/intel/intel-nvme.c:1396:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/intel/intel-nvme.c:1401:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/intel/intel-nvme.c:1408:9: branch_false: ...to here nvme-cli-2.16/plugins/intel/intel-nvme.c:1415:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/intel/intel-nvme.c:1421:27: branch_false: ...to here nvme-cli-2.16/plugins/intel/intel-nvme.c:1420:15: call_function: calling ‘read_header’ from ‘get_internal_log’ nvme-cli-2.16/plugins/intel/intel-nvme.c:1420:15: return_function: returning to ‘get_internal_log’ from ‘read_header’ nvme-cli-2.16/plugins/intel/intel-nvme.c:1422:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/intel/intel-nvme.c:1424:9: branch_false: ...to here nvme-cli-2.16/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 # 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-688): [#def16] nvme-cli-2.16/plugins/lm/lm-nvme.c:540:29: warning[-Wanalyzer-null-argument]: use of NULL ‘fd’ where non-null expected nvme-cli-2.16/plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:488:38: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:494:13: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:514:15: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:532:17: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:534:18: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:535:21: branch_true: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch... nvme-cli-2.16/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): [#def17] nvme-cli-2.16/plugins/lm/lm-nvme.c:540:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fd’ where non-null expected nvme-cli-2.16/plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:488:38: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:494:13: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:503:22: acquire_memory: this call could return NULL nvme-cli-2.16/plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:514:15: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:532:17: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:534:18: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:535:21: branch_true: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:540:29: danger: argument 4 (‘fd’) from [(7)](sarif:/runs/0/results/3/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-401): [#def18] nvme-cli-2.16/plugins/lm/lm-nvme.c:552:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fd’ nvme-cli-2.16/plugins/lm/lm-nvme.c:421:12: enter_function: entry to ‘lm_migration_recv’ nvme-cli-2.16/plugins/lm/lm-nvme.c:485:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:488:38: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:489:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:494:13: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:502:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:503:22: acquire_memory: allocated here nvme-cli-2.16/plugins/lm/lm-nvme.c:511:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:514:15: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:530:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:532:17: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:532:17: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:534:18: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:534:17: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:535:21: branch_true: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:539:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:438:30: call_function: inlined call to ‘cleanup_file’ from ‘lm_migration_recv’ nvme-cli-2.16/plugins/lm/lm-nvme.c:437:45: call_function: inlined call to ‘cleanup_nvme_dev’ from ‘lm_migration_recv’ nvme-cli-2.16/plugins/lm/lm-nvme.c:552:1: danger: ‘fd’ leaks here; was allocated at [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7) # 550| # 551| return 0; # 552|-> } # 553| # 554| enum lm_controller_data_queue_feature_id { Error: GCC_ANALYZER_WARNING (CWE-404): [#def19] nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:413:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:576:12: enter_function: entry to ‘mb_set_high_latency_log’ nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:607:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:610:13: branch_false: ...to here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:610:13: call_function: calling ‘parse_params’ from ‘mb_set_high_latency_log’ # 411| # 412| return 0; # 413|-> } # 414| # 415| static int mb_get_additional_smart_log(int argc, char **argv, struct command *cmd, Error: GCC_ANALYZER_WARNING (CWE-688): [#def20] nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:927:9: warning[-Wanalyzer-null-argument]: use of NULL ‘fd’ where non-null expected nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:932:5: enter_function: entry to ‘io_latency_histogram’ nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:934:21: acquire_memory: allocated here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:943:9: release_memory: assuming ‘fopen(file, "w+")’ is NULL nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:943:9: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:943:9: branch_false: ...to here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:944:9: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:944:9: branch_false: ...to here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:947:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:948:17: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:948:17: branch_false: ...to here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:949:17: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:949:17: branch_false: ...to here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:950:17: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:950:17: branch_false: ...to here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:954:29: branch_true: following ‘true’ branch (when ‘i != 32’)... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:955:28: branch_true: ...to here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:955:28: branch_false: following ‘false’ branch (when ‘i != 31’)... nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:960:78: branch_false: ...to here nvme-cli-2.16/plugins/memblaze/memblaze-nvme.c:960:33: call_function: calling ‘ioLatencyHistogramOutput’ from ‘io_latency_histogram’ # 925| len = snprintf(string, sizeof(string), "%-11d %-11s %-11s %-11u\n", # 926| index, subString0, subString1, pHistogram[index]); # 927|-> fwrite(string, 1, len, fd); # 928| if (print) # 929| printf("%s", string); Error: GCC_ANALYZER_WARNING (CWE-457): [#def21] nvme-cli-2.16/plugins/micron/micron-nvme.c:2191:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*strOSDirName’ nvme-cli-2.16/plugins/micron/micron-nvme.c:3740:12: enter_function: entry to ‘micron_internal_logs’ nvme-cli-2.16/plugins/micron/micron-nvme.c:3840:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/micron/micron-nvme.c:3844:20: branch_false: ...to here nvme-cli-2.16/plugins/micron/micron-nvme.c:3857:19: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/micron/micron-nvme.c:3864:21: branch_false: ...to here nvme-cli-2.16/plugins/micron/micron-nvme.c:3864:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/micron/micron-nvme.c:3875:24: branch_false: ...to here nvme-cli-2.16/plugins/micron/micron-nvme.c:3878:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/micron/micron-nvme.c:3883:15: branch_false: ...to here nvme-cli-2.16/plugins/micron/micron-nvme.c:3884:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/micron/micron-nvme.c:3888:12: branch_false: ...to here nvme-cli-2.16/plugins/micron/micron-nvme.c:3888:12: branch_false: following ‘false’ branch (when ‘telemetry_option == 0’)... nvme-cli-2.16/plugins/micron/micron-nvme.c:3905:9: branch_false: ...to here nvme-cli-2.16/plugins/micron/micron-nvme.c:3910:21: branch_true: following ‘true’ branch (when ‘i != 20’)... nvme-cli-2.16/plugins/micron/micron-nvme.c:3911:21: branch_true: ...to here nvme-cli-2.16/plugins/micron/micron-nvme.c:3910:21: branch_true: following ‘true’ branch (when ‘i != 20’)... nvme-cli-2.16/plugins/micron/micron-nvme.c:3911:21: branch_true: ...to here nvme-cli-2.16/plugins/micron/micron-nvme.c:3918:9: call_function: calling ‘SetupDebugDataDirectories’ from ‘micron_internal_logs’ nvme-cli-2.16/plugins/micron/micron-nvme.c:3918:9: return_function: returning to ‘micron_internal_logs’ from ‘SetupDebugDataDirectories’ nvme-cli-2.16/plugins/micron/micron-nvme.c:3921:9: call_function: calling ‘GetTimestampInfo’ from ‘micron_internal_logs’ # 2189| num += sprintf((char *)(outstr + num), "\nPackage Version: 1.4"); # 2190| if (num) { # 2191|-> strPDir = strdup(strOSDirName); # 2192| strDest = dirname(strPDir); # 2193| WriteData(outstr, num, strDest, "timestamp_info.txt", "timestamp"); Error: GCC_ANALYZER_WARNING: [#def22] nvme-cli-2.16/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.16/plugins/ocp/ocp-hardware-component-log.c:193:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/ocp/ocp-hardware-component-log.c:199:33: branch_false: ...to here nvme-cli-2.16/plugins/ocp/ocp-hardware-component-log.c:210:12: branch_false: following ‘false’ branch (when ‘log_bytes > 6.4e+1l’)... nvme-cli-2.16/plugins/ocp/ocp-hardware-component-log.c:215:20: branch_false: ...to here nvme-cli-2.16/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-688): [#def23] nvme-cli-2.16/plugins/ocp/ocp-nvme.c:888:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected nvme-cli-2.16/plugins/ocp/ocp-nvme.c:871:22: acquire_memory: this call could return NULL nvme-cli-2.16/plugins/ocp/ocp-nvme.c:887:21: branch_true: following ‘true’ branch (when ‘i < total_loop_cnt’)... nvme-cli-2.16/plugins/ocp/ocp-nvme.c:888:17: branch_true: ...to here nvme-cli-2.16/plugins/ocp/ocp-nvme.c:888:17: danger: argument 1 (‘data’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected # 886| # 887| for (i = 0; i < total_loop_cnt; i++) { # 888|-> memset(data, 0, transfersize); # 889| # 890| struct nvme_get_log_args args = { Error: GCC_ANALYZER_WARNING (CWE-775): [#def24] nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2994:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’ nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2950:12: enter_function: entry to ‘error_injection_set’ nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2979:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2984:13: branch_false: ...to here nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2984:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2985:23: acquire_resource: opened here nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2986:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2990:40: branch_false: ...to here nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2965:26: call_function: inlined call to ‘cleanup_fd’ from ‘error_injection_set’ nvme-cli-2.16/plugins/ocp/ocp-nvme.c:3020:1: branch_false: ...to here nvme-cli-2.16/plugins/ocp/ocp-nvme.c:2994:32: danger: ‘ffd’ leaks here; was opened at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5) # 2992| nvme_show_error("failed to read data buffer from input file: %s", # 2993| strerror(errno)); # 2994|-> return -errno; # 2995| } # 2996| } else { Error: GCC_ANALYZER_WARNING (CWE-688): [#def25] nvme-cli-2.16/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.16/plugins/ocp/ocp-telemetry-decode.c:870:6: enter_function: entry to ‘parse_common_event’ nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:889:20: branch_true: following ‘true’ branch (when ‘pevent_fifos_object’ is non-NULL)... nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:890:25: branch_true: ...to here nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:890:25: call_function: calling ‘json_add_formatted_u32_str’ from ‘parse_common_event’ nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:890:25: return_function: returning to ‘parse_common_event’ from ‘json_add_formatted_u32_str’ nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:892:25: call_function: calling ‘json_object_add_value_string’ from ‘parse_common_event’ nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:892:25: return_function: returning to ‘parse_common_event’ from ‘json_object_add_value_string’ nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:894:25: call_function: calling ‘json_add_formatted_var_size_str’ from ‘parse_common_event’ # 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): [#def26] nvme-cli-2.16/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.16/plugins/ocp/ocp-telemetry-decode.c:1755:5: enter_function: entry to ‘print_ocp_telemetry_json’ nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:1821:18: call_function: calling ‘parse_statistics’ from ‘print_ocp_telemetry_json’ nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:1821:18: return_function: returning to ‘print_ocp_telemetry_json’ from ‘parse_statistics’ nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:1822:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:1828:18: branch_false: ...to here nvme-cli-2.16/plugins/ocp/ocp-telemetry-decode.c:1828:18: call_function: calling ‘parse_event_fifos’ from ‘print_ocp_telemetry_json’ # 987| char *description = (char *)malloc((40 + 1) * sizeof(char)); # 988| # 989|-> memset(description, 0, sizeof(40)); # 990| # 991| status = Error: GCC_ANALYZER_WARNING (CWE-688): [#def27] nvme-cli-2.16/plugins/sed/sedopal_cmd.c:189:29: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected nvme-cli-2.16/plugins/sed/sedopal_cmd.c:148:5: enter_function: entry to ‘sedopal_set_key’ nvme-cli-2.16/plugins/sed/sedopal_cmd.c:157:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/sed/sedopal_cmd.c:164:21: branch_true: ...to here nvme-cli-2.16/plugins/sed/sedopal_cmd.c:173:24: call_function: calling ‘sedopal_get_password’ from ‘sedopal_set_key’ nvme-cli-2.16/plugins/sed/sedopal_cmd.c:173:24: return_function: returning to ‘sedopal_set_key’ from ‘sedopal_get_password’ nvme-cli-2.16/plugins/sed/sedopal_cmd.c:174:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/sed/sedopal_cmd.c:178:17: branch_false: ...to here nvme-cli-2.16/plugins/sed/sedopal_cmd.c:187:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/sed/sedopal_cmd.c:188:32: branch_true: ...to here nvme-cli-2.16/plugins/sed/sedopal_cmd.c:189:29: danger: argument 2 (‘sedopal_get_password("Re-enter New Password: ")’) NULL where non-null expected # 187| if (sedopal_ask_new_key) { # 188| pass = sedopal_get_password(SEDOPAL_REENTER_PW_PROMPT); # 189|-> if (strncmp((char *)key->key, pass, key->key_len)) { # 190| fprintf(stderr, # 191| "Error: passwords don't match\n"); Error: GCC_ANALYZER_WARNING (CWE-476): [#def28] nvme-cli-2.16/plugins/sed/sedopal_cmd.c:583:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘data’ nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1066:5: enter_function: entry to ‘sedopal_cmd_discover’ nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1074:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1074:12: branch_false: ...to here nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1080:16: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1081:17: branch_true: ...to here nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1081:17: call_function: calling ‘sedopal_parse_features’ from ‘sedopal_cmd_discover’ nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1081:17: return_function: returning to ‘sedopal_cmd_discover’ from ‘sedopal_parse_features’ nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1080:16: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1088:15: branch_false: ...to here nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1088:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1092:17: branch_false: ...to here nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1092:17: release_memory: using NULL here nvme-cli-2.16/plugins/sed/sedopal_cmd.c:1092:17: call_function: calling ‘sedopal_print_locking_features’ from ‘sedopal_cmd_discover’ # 581| { # 582| struct locking_desc *ld = (struct locking_desc *)data; # 583|-> uint8_t features = ld->features; # 584| # 585| if (!sedopal_discovery_udev) { Error: GCC_ANALYZER_WARNING (CWE-775): [#def29] nvme-cli-2.16/plugins/shannon/shannon-nvme.c:328:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cfg.file, 0)’ nvme-cli-2.16/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:328:28: danger: ‘open(cfg.file, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10) # 326| if (strlen(cfg.file)) { # 327| ffd = open(cfg.file, O_RDONLY); # 328|-> if (ffd <= 0) { # 329| fprintf(stderr, "no firmware file provided\n"); # 330| err = EINVAL; Error: GCC_ANALYZER_WARNING: [#def30] nvme-cli-2.16/plugins/shannon/shannon-nvme.c:334:23: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘ffd’ nvme-cli-2.16/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:334:23: danger: ‘ffd’ could be invalid: unchecked value from [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10) # 332| } # 333| } # 334|-> err = read(ffd, (void *)buf, cfg.data_len); # 335| if (err < 0) { # 336| fprintf(stderr, "failed to read data buffer from input file\n"); Error: GCC_ANALYZER_WARNING (CWE-775): [#def31] nvme-cli-2.16/plugins/shannon/shannon-nvme.c:338:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’ nvme-cli-2.16/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:335:20: branch_true: following ‘true’ branch (when ‘err < 0’)... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:336:25: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:338:25: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10) # 336| fprintf(stderr, "failed to read data buffer from input file\n"); # 337| err = EINVAL; # 338|-> goto free; # 339| } # 340| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def32] nvme-cli-2.16/plugins/shannon/shannon-nvme.c:360:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’ nvme-cli-2.16/plugins/shannon/shannon-nvme.c:307:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:310:14: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:310:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:316:13: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:316:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:317:21: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:326:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:327:31: branch_true: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:327:31: acquire_resource: opened here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:328:28: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:334:46: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:335:20: branch_false: following ‘false’ branch (when ‘err >= 0’)... nvme-cli-2.16/plugins/shannon/shannon-nvme.c:342:39: branch_false: ...to here nvme-cli-2.16/plugins/shannon/shannon-nvme.c:360:17: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10) # 358| if (err < 0) { # 359| perror("set-feature"); # 360|-> goto free; # 361| } # 362| if (!err) { Error: CPPCHECK_WARNING (CWE-457): [#def33] nvme-cli-2.16/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: GCC_ANALYZER_WARNING (CWE-775): [#def34] nvme-cli-2.16/plugins/zns/zns.c:432:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’ nvme-cli-2.16/plugins/zns/zns.c:384:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:387:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:395:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:401:12: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:401:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:402:22: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:415:21: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:415:21: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:421:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:422:31: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:422:31: acquire_resource: opened here nvme-cli-2.16/plugins/zns/zns.c:423:28: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:429:46: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:430:20: branch_true: following ‘true’ branch (when ‘err < 0’)... nvme-cli-2.16/plugins/zns/zns.c:431:25: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:465:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:467:1: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:432:25: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10) # 430| if (err < 0) { # 431| perror("read"); # 432|-> goto close_ffd; # 433| } # 434| } else { Error: GCC_ANALYZER_WARNING (CWE-775): [#def35] nvme-cli-2.16/plugins/zns/zns.c:455:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ffd’ nvme-cli-2.16/plugins/zns/zns.c:384:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:387:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:395:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:401:12: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:401:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:402:22: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:415:21: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:415:21: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:421:20: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:422:31: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:422:31: acquire_resource: opened here nvme-cli-2.16/plugins/zns/zns.c:423:28: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:429:46: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:430:20: branch_false: following ‘false’ branch (when ‘err >= 0’)... nvme-cli-2.16/plugins/zns/zns.c:446:35: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:465:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:467:1: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:455:15: danger: ‘ffd’ leaks here; was opened at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10) # 453| .result = NULL, # 454| }; # 455|-> err = nvme_zns_mgmt_send(&args); # 456| if (!err) # 457| printf("zone-mgmt-send: Success, action:%d zone:%"PRIx64" all:%d nsid:%d\n", Error: GCC_ANALYZER_WARNING (CWE-775): [#def36] nvme-cli-2.16/plugins/zns/zns.c:1137:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’ nvme-cli-2.16/plugins/zns/zns.c:1077:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1080:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1080:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1086:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1095:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1100:9: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1102:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1110:21: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1120:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1126:13: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1126:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1127:23: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1127:23: acquire_resource: opened here nvme-cli-2.16/plugins/zns/zns.c:1128:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1134:49: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1221:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1223:1: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1137:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12) # 1135| fprintf(stderr, "No memory for data size:%"PRIx64"\n", # 1136| (uint64_t)cfg.data_size); # 1137|-> goto close_dfd; # 1138| } # 1139| Error: GCC_ANALYZER_WARNING (CWE-775): [#def37] nvme-cli-2.16/plugins/zns/zns.c:1144:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’ nvme-cli-2.16/plugins/zns/zns.c:1077:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1080:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1080:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1086:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1095:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1100:9: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1102:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1110:21: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1120:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1126:13: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1126:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1127:23: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1127:23: acquire_resource: opened here nvme-cli-2.16/plugins/zns/zns.c:1128:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1134:49: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1134:13: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1134:13: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1221:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1223:1: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1144:17: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12) # 1142| if (err < 0) { # 1143| perror("read-data"); # 1144|-> goto free_data; # 1145| } # 1146| Error: GCC_ANALYZER_WARNING (CWE-775): [#def38] nvme-cli-2.16/plugins/zns/zns.c:1161:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dfd’ nvme-cli-2.16/plugins/zns/zns.c:1077:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1080:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1080:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1086:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1095:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1100:9: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1102:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1110:21: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1120:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1126:13: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1126:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1127:23: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1127:23: acquire_resource: opened here nvme-cli-2.16/plugins/zns/zns.c:1128:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1134:49: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1134:13: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1134:13: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1142:12: branch_false: following ‘false’ branch (when ‘err >= 0’)... nvme-cli-2.16/plugins/zns/zns.c:1147:13: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1147:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1148:23: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1149:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1156:13: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1156:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1157:21: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1157:21: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1158:25: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1216:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1218:1: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1221:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1223:1: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1161:25: danger: ‘dfd’ leaks here; was opened at [(13)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/12) # 1159| meta_size); # 1160| err = -1; # 1161|-> goto close_mfd; # 1162| } # 1163| Error: GCC_ANALYZER_WARNING (CWE-775): [#def39] nvme-cli-2.16/plugins/zns/zns.c:1161:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘mfd’ nvme-cli-2.16/plugins/zns/zns.c:1077:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1080:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1080:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1086:14: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1095:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1100:9: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1102:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1110:21: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1120:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1126:13: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1134:13: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1134:13: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1142:12: branch_false: following ‘false’ branch (when ‘err >= 0’)... nvme-cli-2.16/plugins/zns/zns.c:1147:13: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1147:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1148:23: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1148:23: acquire_resource: opened here nvme-cli-2.16/plugins/zns/zns.c:1149:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1156:13: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1156:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/zns/zns.c:1157:21: branch_true: ...to here nvme-cli-2.16/plugins/zns/zns.c:1157:21: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1158:25: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1216:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1218:1: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1221:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/zns/zns.c:1223:1: branch_false: ...to here nvme-cli-2.16/plugins/zns/zns.c:1161:25: danger: ‘mfd’ leaks here; was opened at [(17)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/16) # 1159| meta_size); # 1160| err = -1; # 1161|-> goto close_mfd; # 1162| } # 1163| Error: GCC_ANALYZER_WARNING (CWE-401): [#def40] nvme-cli-2.16/util/cleanup.h:26:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ nvme-cli-2.16/nvme-print-json.c:2254:13: enter_function: entry to ‘json_phy_rx_eom_log’ nvme-cli-2.16/nvme-print-json.c:2280:12: branch_true: following ‘true’ branch... nvme-cli-2.16/nvme-print-json.c:2282:41: branch_true: ...to here nvme-cli-2.16/nvme-print-json.c:2283:20: branch_true: following ‘true’ branch... nvme-cli-2.16/nvme-print-json.c:2284:25: branch_true: ...to here nvme-cli-2.16/nvme-print-json.c:2284:25: call_function: calling ‘json_phy_rx_eom_descs’ from ‘json_phy_rx_eom_log’ nvme-cli-2.16/nvme-print-json.c:2284:25: return_function: returning to ‘json_phy_rx_eom_log’ from ‘json_phy_rx_eom_descs’ nvme-cli-2.16/nvme-print-json.c:2288:29: branch_false: following ‘false’ branch... nvme-cli-2.16/nvme-print-json.c:2294:9: branch_false: ...to here nvme-cli-2.16/nvme-print-json.c:2259:31: call_function: inlined call to ‘freep’ from ‘json_phy_rx_eom_log’ # 24| static inline void freep(void *p) # 25| { # 26|-> free(*(void **)p); # 27| } # 28| #define _cleanup_free_ __cleanup__(freep) Error: GCC_ANALYZER_WARNING (CWE-910): [#def41] nvme-cli-2.16/util/cleanup.h:55:15: warning[-Wanalyzer-double-fclose]: double ‘fclose’ of FILE ‘file’ nvme-cli-2.16/plugins/lm/lm-nvme.c:269:12: enter_function: entry to ‘lm_migration_send’ nvme-cli-2.16/plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:348:13: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:354:13: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:373:24: acquire_resource: opened here nvme-cli-2.16/plugins/lm/lm-nvme.c:374:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:379:40: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:380:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:383:48: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:385:17: release_resource: first ‘fclose’ here nvme-cli-2.16/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): [#def42] nvme-cli-2.16/util/cleanup.h:55:15: warning[-Wanalyzer-double-free]: double-‘fclose’ of ‘file’ nvme-cli-2.16/plugins/lm/lm-nvme.c:269:12: enter_function: entry to ‘lm_migration_send’ nvme-cli-2.16/plugins/lm/lm-nvme.c:345:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:348:13: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:348:12: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:354:13: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:372:12: branch_true: following ‘true’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:373:24: acquire_memory: allocated here nvme-cli-2.16/plugins/lm/lm-nvme.c:374:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:379:40: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:380:20: branch_false: following ‘false’ branch... nvme-cli-2.16/plugins/lm/lm-nvme.c:383:48: branch_false: ...to here nvme-cli-2.16/plugins/lm/lm-nvme.c:385:17: release_memory: first ‘fclose’ here nvme-cli-2.16/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-688): [#def43] nvme-cli-2.16/util/mem.c:34:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected nvme-cli-2.16/util/mem.c:27:7: enter_function: entry to ‘nvme_realloc’ nvme-cli-2.16/util/mem.c:31:24: call_function: calling ‘nvme_alloc’ from ‘nvme_realloc’ nvme-cli-2.16/util/mem.c:31:24: return_function: returning to ‘nvme_realloc’ from ‘nvme_alloc’ nvme-cli-2.16/util/mem.c:33:12: branch_true: following ‘true’ branch (when ‘p’ is non-NULL)... nvme-cli-2.16/util/mem.c:34:17: branch_true: ...to here nvme-cli-2.16/util/mem.c:34:17: danger: argument 1 (‘nvme_alloc(len)’) NULL where non-null expected # 32| # 33| if (p) { # 34|-> memcpy(result, p, min(old_len, len)); # 35| free(p); # 36| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def44] nvme-cli-2.16/util/utils.c:34:37: warning[-Wanalyzer-malloc-leak]: leak of ‘hex_to_ascii(&buffer)’ nvme-cli-2.16/util/utils.c:179:6: enter_function: entry to ‘process_field_size_8’ nvme-cli-2.16/util/utils.c:189:19: branch_true: following ‘true’ branch... nvme-cli-2.16/util/utils.c:190:22: branch_true: ...to here nvme-cli-2.16/util/utils.c:195:17: call_function: calling ‘hex_to_ascii’ from ‘process_field_size_8’ nvme-cli-2.16/util/utils.c:195:17: return_function: returning to ‘process_field_size_8’ from ‘hex_to_ascii’ nvme-cli-2.16/util/utils.c:34:37: danger: ‘hex_to_ascii(&buffer)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8) # 32| if (hex_length > 0) { # 33| int symbol_count; # 34|-> int odd_hex_count = hex_length % 2 == 1; # 35| # 36| if (odd_hex_count) Error: GCC_ANALYZER_WARNING (CWE-476): [#def45] nvme-cli-2.16/util/utils.c:56:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘text’ nvme-cli-2.16/util/utils.c:179:6: enter_function: entry to ‘process_field_size_8’ nvme-cli-2.16/util/utils.c:189:19: branch_true: following ‘true’ branch... nvme-cli-2.16/util/utils.c:190:22: branch_true: ...to here nvme-cli-2.16/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| }
| analyzer-version-clippy | 1.97.1 |
| analyzer-version-cppcheck | 2.21.1 |
| analyzer-version-gcc | 16.1.1 |
| analyzer-version-gcc-analyzer | 16.1.1 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-63.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | nvme-cli-2.16-2.fc44 |
| store-results-to | /tmp/tmpz27jbkt5/nvme-cli-2.16-2.fc44.tar.xz |
| time-created | 2026-08-03 18:44:58 |
| time-finished | 2026-08-03 18:47:57 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpz27jbkt5/nvme-cli-2.16-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpz27jbkt5/nvme-cli-2.16-2.fc44.src.rpm' |
| tool-version | csmock-3.8.7.20260803.142340.gb75b18e-1.el9 |