nftables-1.1.5-2.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
nftables-1.1.5/src/datatype.c:885:13: warning[-Wanalyzer-file-leak]: leak of FILE 'open_iproute2_db(filename, & path)'
nftables-1.1.5/src/datatype.c:909:22: enter_function: entry to 'rt_symbol_table_init'
nftables-1.1.5/src/datatype.c:922:13: call_function: calling 'open_iproute2_db' from 'rt_symbol_table_init'
nftables-1.1.5/src/datatype.c:922:13: return_function: returning to 'rt_symbol_table_init' from 'open_iproute2_db'
nftables-1.1.5/src/datatype.c:923:12: branch_false: following 'false' branch...
nftables-1.1.5/src/datatype.c:923:12: branch_false: ...to here
nftables-1.1.5/src/datatype.c:926:16: branch_true: following 'true' branch...
nftables-1.1.5/src/datatype.c:926:16: branch_true: ...to here
nftables-1.1.5/src/datatype.c:945:20: branch_false: following 'false' branch...
nftables-1.1.5/src/datatype.c:950:51: branch_false: ...to here
nftables-1.1.5/src/datatype.c:950:51: throw: if 'xstrdup' throws an exception...
nftables-1.1.5/src/datatype.c:885:13: danger: 'open_iproute2_db(filename, & path)' leaks here; was opened at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#  883|   	FILE *ret;
#  884|   
#  885|-> 	if (filename[0] == '/')
#  886|   		return fopen(filename, "r");
#  887|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
nftables-1.1.5/src/datatype.c:885:13: warning[-Wanalyzer-malloc-leak]: leak of 'open_iproute2_db(filename, & path)'
nftables-1.1.5/src/datatype.c:909:22: enter_function: entry to 'rt_symbol_table_init'
nftables-1.1.5/src/datatype.c:922:13: call_function: calling 'open_iproute2_db' from 'rt_symbol_table_init'
nftables-1.1.5/src/datatype.c:922:13: return_function: returning to 'rt_symbol_table_init' from 'open_iproute2_db'
nftables-1.1.5/src/datatype.c:923:12: branch_false: following 'false' branch...
nftables-1.1.5/src/datatype.c:923:12: branch_false: ...to here
nftables-1.1.5/src/datatype.c:926:16: branch_true: following 'true' branch...
nftables-1.1.5/src/datatype.c:926:16: branch_true: ...to here
nftables-1.1.5/src/datatype.c:945:20: branch_false: following 'false' branch...
nftables-1.1.5/src/datatype.c:950:51: branch_false: ...to here
nftables-1.1.5/src/datatype.c:950:51: throw: if 'xstrdup' throws an exception...
nftables-1.1.5/src/datatype.c:885:13: danger: 'open_iproute2_db(filename, & path)' leaks here; was allocated at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5)
#  883|   	FILE *ret;
#  884|   
#  885|-> 	if (filename[0] == '/')
#  886|   		return fopen(filename, "r");
#  887|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
nftables-1.1.5/src/datatype.c:1516:24: warning[-Wanalyzer-malloc-leak]: leak of 'rate_str'
nftables-1.1.5/src/datatype.c:1521:22: enter_function: entry to 'rate_parse'
nftables-1.1.5/src/datatype.c:1528:12: branch_false: following 'false' branch (when 'slash' is non-NULL)...
nftables-1.1.5/src/datatype.c:1531:33: branch_false: ...to here
nftables-1.1.5/src/datatype.c:1531:20: acquire_memory: allocated here
nftables-1.1.5/src/datatype.c:1532:12: branch_false: following 'false' branch (when 'rate_str' is non-NULL)...
nftables-1.1.5/src/datatype.c:1535:16: branch_false: ...to here
nftables-1.1.5/src/datatype.c:1535:16: call_function: calling 'data_unit_parse' from 'rate_parse'
# 1514|   		*rate = 1024 * 1024;
# 1515|   	else
# 1516|-> 		return error(loc, "Wrong unit format, expecting bytes, kbytes or mbytes");
# 1517|   
# 1518|   	return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
nftables-1.1.5/src/datatype.c:1671:24: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(path)'
nftables-1.1.5/src/datatype.c:1667:13: acquire_memory: allocated here
nftables-1.1.5/src/datatype.c:1668:12: branch_false: following 'false' branch...
nftables-1.1.5/src/datatype.c:1668:12: branch_false: ...to here
nftables-1.1.5/src/datatype.c:1671:24: throw: if 'readdir' throws an exception...
nftables-1.1.5/src/datatype.c:1671:24: danger: 'opendir(path)' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1669|   		return NULL;
# 1670|   
# 1671|-> 	while ((dent = readdir(d)) != NULL) {
# 1672|   		if (!strcmp(dent->d_name, ".") ||
# 1673|   		    !strcmp(dent->d_name, ".."))

Error: GCC_ANALYZER_WARNING (CWE-404): [#def5]
nftables-1.1.5/src/erec.c:57:16: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
nftables-1.1.5/src/erec.c:223:23: enter_function: entry to '__stmt_binary_error'
nftables-1.1.5/src/erec.c:231:9: acquire_resource: 'va_start' called here
nftables-1.1.5/src/erec.c:232:16: call_function: calling 'erec_vcreate' from '__stmt_binary_error'
#   55|   	struct error_record *erec;
#   56|   
#   57|-> 	erec = xmalloc(sizeof(*erec));
#   58|   	erec->type		= type;
#   59|   	erec->num_locations	= 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
nftables-1.1.5/src/erec.c:119:23: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(*indesc.name, "r")'
nftables-1.1.5/src/erec.c:129:6: enter_function: entry to 'erec_print'
nftables-1.1.5/src/erec.c:153:24: call_function: calling 'line_location' from 'erec_print'
#  117|   		return NULL;
#  118|   
#  119|-> 	if (!fseek(f, loc->line_offset, SEEK_SET) &&
#  120|   	    fread(buf, 1, bufsiz - 1, f) > 0) {
#  121|   		*strchrnul(buf, '\n') = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
nftables-1.1.5/src/erec.c:119:23: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(*indesc.name, "r")'
nftables-1.1.5/src/erec.c:129:6: enter_function: entry to 'erec_print'
nftables-1.1.5/src/erec.c:153:24: call_function: calling 'line_location' from 'erec_print'
#  117|   		return NULL;
#  118|   
#  119|-> 	if (!fseek(f, loc->line_offset, SEEK_SET) &&
#  120|   	    fread(buf, 1, bufsiz - 1, f) > 0) {
#  121|   		*strchrnul(buf, '\n') = '\0';

Error: GCC_ANALYZER_WARNING (CWE-404): [#def8]
nftables-1.1.5/src/json.c:43:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
nftables-1.1.5/src/json.c:2076:13: enter_function: entry to 'monitor_print_json'
nftables-1.1.5/src/json.c:2081:15: call_function: calling '__nft_json_pack' from 'monitor_print_json'
#   41|   
#   42|   	va_start(ap, fmt);
#   43|-> 	value = json_vpack_ex(&error, 0, fmt, ap);
#   44|   	va_end(ap);
#   45|   

Error: COMPILER_WARNING (CWE-704): [#def9]
nftables-1.1.5/src/libnftables.c: scope_hint: In function 'nft_ctx_add_var'
nftables-1.1.5/src/libnftables.c:135:27: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  135 |         char *separator = strchr(var, '=');
#      |                           ^~~~~~
#  133|   int nft_ctx_add_var(struct nft_ctx *ctx, const char *var)
#  134|   {
#  135|-> 	char *separator = strchr(var, '=');
#  136|   	int pcount = ctx->num_vars;
#  137|   	struct nft_vars *tmp;

Error: COMPILER_WARNING (CWE-704): [#def10]
nftables-1.1.5/src/libnftables.c:135:27: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  133|   int nft_ctx_add_var(struct nft_ctx *ctx, const char *var)
#  134|   {
#  135|-> 	char *separator = strchr(var, '=');
#  136|   	int pcount = ctx->num_vars;
#  137|   	struct nft_vars *tmp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
nftables-1.1.5/src/main.c:532:24: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
nftables-1.1.5/src/main.c:359:5: enter_function: entry to ‘main’
nftables-1.1.5/src/main.c:361:40: call_function: calling ‘get_options’ from ‘main’
nftables-1.1.5/src/main.c:361:40: return_function: returning to ‘main’ from ‘get_options’
nftables-1.1.5/src/main.c:363:33: call_function: calling ‘get_optstring’ from ‘main’
nftables-1.1.5/src/main.c:363:33: return_function: returning to ‘main’ from ‘get_optstring’
nftables-1.1.5/src/main.c:371:12: branch_false: following ‘false’ branch...
nftables-1.1.5/src/main.c:374:14: branch_false: ...to here
nftables-1.1.5/src/main.c:374:12: branch_true: following ‘true’ branch...
nftables-1.1.5/src/main.c:377:15: branch_true: ...to here
nftables-1.1.5/src/main.c:508:12: branch_false: following ‘false’ branch...
nftables-1.1.5/src/main.c:513:9: branch_false: ...to here
nftables-1.1.5/src/main.c:515:12: branch_true: following ‘true’ branch...
nftables-1.1.5/src/main.c:515:12: branch_true: ...to here
nftables-1.1.5/src/main.c:521:23: acquire_memory: allocated here
nftables-1.1.5/src/main.c:522:20: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
nftables-1.1.5/src/main.c:527:22: branch_false: ...to here
nftables-1.1.5/src/main.c:527:34: branch_false: following ‘false’ branch (when ‘i >= argc’)...
nftables-1.1.5/src/main.c:532:24: branch_false: ...to here
nftables-1.1.5/src/main.c:532:24: throw: if ‘nft_run_cmd_from_buffer’ throws an exception...
nftables-1.1.5/src/main.c:532:24: danger: ‘buf’ leaks here; was allocated at [(30)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/29)
#  530|   				strcat(buf, " ");
#  531|   		}
#  532|-> 		rc = !!nft_run_cmd_from_buffer(nft, buf);
#  533|   		free(buf);
#  534|   	} else if (filename != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-121): [#def12]
nftables-1.1.5/src/mnl.c:1779:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
nftables-1.1.5/src/mnl.c:1788:12: enter_function: entry to 'mnl_nft_setelem_batch'
nftables-1.1.5/src/mnl.c:1804:12: branch_true: following 'true' branch (when 'init' is non-NULL)...
nftables-1.1.5/src/mnl.c:1805:24: branch_true: ...to here
nftables-1.1.5/src/mnl.c:1805:24: branch_true: following 'true' branch...
nftables-1.1.5/src/mnl.c:1805:24: branch_true: ...to here
nftables-1.1.5/src/mnl.c:1825:12: branch_false: following 'false' branch (when 'init' is non-NULL)...
nftables-1.1.5/src/mnl.c:1825:34: branch_false: ...to here
nftables-1.1.5/src/mnl.c:1825:34: branch_true: following 'true' branch...
nftables-1.1.5/src/mnl.c:1825:22: branch_true: ...to here
nftables-1.1.5/src/mnl.c:1825:13: branch_false: following 'false' branch...
nftables-1.1.5/src/mnl.c:1828:9: branch_false: ...to here
nftables-1.1.5/src/mnl.c:1828:9: branch_true: following 'true' branch (when 'expr' is non-NULL)...
nftables-1.1.5/src/mnl.c:1829:17: branch_true: ...to here
nftables-1.1.5/src/mnl.c:1830:9: branch_true: following 'true' branch...
nftables-1.1.5/src/mnl.c:1833:28: branch_true: following 'true' branch...
nftables-1.1.5/src/mnl.c:1834:30: call_function: inlined call to 'list_is_last' from 'mnl_nft_setelem_batch'
nftables-1.1.5/src/mnl.c:1833:29: branch_true: following 'true' branch...
nftables-1.1.5/src/mnl.c:1839:29: branch_true: ...to here
nftables-1.1.5/src/mnl.c:1839:28: branch_true: following 'true' branch...
nftables-1.1.5/src/mnl.c:1840:40: branch_true: ...to here
nftables-1.1.5/src/mnl.c:1840:40: call_function: calling 'alloc_nftnl_setelem_interval' from 'mnl_nft_setelem_batch'
# 1777|   
# 1778|   	list_for_each_entry_safe(expr, next, &interval_list, list) {
# 1779|-> 		nlse[i++] = alloc_nftnl_setelem(init, expr);
# 1780|   		list_del(&expr->list);
# 1781|   		expr_free(expr);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def13]
nftables-1.1.5/src/mnl.c:2285:13: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2283|   static bool basehook_eq(const struct basehook *prev, const struct basehook *hook)
# 2284|   {
# 2285|-> 	if (prev->num != hook->num)
# 2286|   		return false;
# 2287|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def14]
nftables-1.1.5/src/mnl.c:2285:26: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2283|   static bool basehook_eq(const struct basehook *prev, const struct basehook *hook)
# 2284|   {
# 2285|-> 	if (prev->num != hook->num)
# 2286|   		return false;
# 2287|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def15]
nftables-1.1.5/src/mnl.c:2288:13: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2286|   		return false;
# 2287|   
# 2288|-> 	if (prev->devname != NULL && hook->devname != NULL)
# 2289|   		return strcmp(prev->devname, hook->devname) == 0;
# 2290|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def16]
nftables-1.1.5/src/mnl.c:2288:38: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2286|   		return false;
# 2287|   
# 2288|-> 	if (prev->devname != NULL && hook->devname != NULL)
# 2289|   		return strcmp(prev->devname, hook->devname) == 0;
# 2290|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def17]
nftables-1.1.5/src/mnl.c:2291:38: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2289|   		return strcmp(prev->devname, hook->devname) == 0;
# 2290|   
# 2291|-> 	if (prev->devname == NULL && hook->devname == NULL)
# 2292|   		return true;
# 2293|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def18]
nftables-1.1.5/src/mnl.c:2566:21: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2564|   
# 2565|   	list_for_each_entry_safe(hook, tmp, hook_list, list) {
# 2566|-> 		if (hook->family == family) {
# 2567|   			family_in_use = true;
# 2568|   			break;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def19]
nftables-1.1.5/src/mnl.c:2578:21: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2576|   
# 2577|   	list_for_each_entry_safe(hook, tmp, hook_list, list) {
# 2578|-> 		if (hook->family != family)
# 2579|   			continue;
# 2580|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def20]
nftables-1.1.5/src/mnl.c:2595:29: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2593|   
# 2594|   		if (!same) {
# 2595|-> 			if (hook->devname)
# 2596|   				fprintf(fp, "\thook %s device %s {\n",
# 2597|   					hooknum2str(family, hook->num), hook->devname);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def21]
nftables-1.1.5/src/mnl.c:2597:61: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2595|   			if (hook->devname)
# 2596|   				fprintf(fp, "\thook %s device %s {\n",
# 2597|-> 					hooknum2str(family, hook->num), hook->devname);
# 2598|   			else
# 2599|   				fprintf(fp, "\thook %s {\n",

Error: GCC_ANALYZER_WARNING (CWE-126): [#def22]
nftables-1.1.5/src/mnl.c:2600:61: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2598|   			else
# 2599|   				fprintf(fp, "\thook %s {\n",
# 2600|-> 					hooknum2str(family, hook->num));
# 2601|   		}
# 2602|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def23]
nftables-1.1.5/src/mnl.c:2603:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2601|   		}
# 2602|   
# 2603|-> 		prio = hook->prio;
# 2604|   		if (prio < 0)
# 2605|   			fprintf(fp, "\t\t%011d", prio); /* outputs a '-' sign */

Error: GCC_ANALYZER_WARNING (CWE-126): [#def24]
nftables-1.1.5/src/mnl.c:2611:21: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2609|   			fprintf(fp, "\t\t+%010u", prio);
# 2610|   
# 2611|-> 		if (hook->table && hook->chain)
# 2612|   			fprintf(fp, " %s %s %s %s",
# 2613|   				hook->objtype, family2str(hook->chain_family),

Error: GCC_ANALYZER_WARNING (CWE-126): [#def25]
nftables-1.1.5/src/mnl.c:2611:36: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2609|   			fprintf(fp, "\t\t+%010u", prio);
# 2610|   
# 2611|-> 		if (hook->table && hook->chain)
# 2612|   			fprintf(fp, " %s %s %s %s",
# 2613|   				hook->objtype, family2str(hook->chain_family),

Error: GCC_ANALYZER_WARNING (CWE-126): [#def26]
nftables-1.1.5/src/mnl.c:2612:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2610|   
# 2611|   		if (hook->table && hook->chain)
# 2612|-> 			fprintf(fp, " %s %s %s %s",
# 2613|   				hook->objtype, family2str(hook->chain_family),
# 2614|   				hook->table, hook->chain);

Error: GCC_ANALYZER_WARNING (CWE-126): [#def27]
nftables-1.1.5/src/mnl.c:2613:59: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2611|   		if (hook->table && hook->chain)
# 2612|   			fprintf(fp, " %s %s %s %s",
# 2613|-> 				hook->objtype, family2str(hook->chain_family),
# 2614|   				hook->table, hook->chain);
# 2615|   		else if (hook->hookfn && hook->chain)

Error: GCC_ANALYZER_WARNING (CWE-126): [#def28]
nftables-1.1.5/src/mnl.c:2615:26: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2613|   				hook->objtype, family2str(hook->chain_family),
# 2614|   				hook->table, hook->chain);
# 2615|-> 		else if (hook->hookfn && hook->chain)
# 2616|   			fprintf(fp, " %s %s", hook->hookfn, hook->chain);
# 2617|   		else if (hook->hookfn) {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def29]
nftables-1.1.5/src/mnl.c:2615:42: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2613|   				hook->objtype, family2str(hook->chain_family),
# 2614|   				hook->table, hook->chain);
# 2615|-> 		else if (hook->hookfn && hook->chain)
# 2616|   			fprintf(fp, " %s %s", hook->hookfn, hook->chain);
# 2617|   		else if (hook->hookfn) {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def30]
nftables-1.1.5/src/mnl.c:2620:21: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
nftables-1.1.5/src/mnl.c:2680:5: enter_function: entry to 'mnl_nft_dump_nf_hooks'
nftables-1.1.5/src/mnl.c:2746:9: call_function: calling 'print_hooks' from 'mnl_nft_dump_nf_hooks'
# 2618|   			fprintf(fp, " %s", hook->hookfn);
# 2619|   		}
# 2620|-> 		if (hook->module_name)
# 2621|   			fprintf(fp, " [%s]", hook->module_name);
# 2622|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def31]
nftables-1.1.5/src/netlink.c:73:16: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
nftables-1.1.5/src/netlink.c:1766:13: enter_function: entry to 'netlink_delinearize_obj'
nftables-1.1.5/src/netlink.c:1783:12: branch_true: following 'true' branch...
nftables-1.1.5/src/netlink.c:1784:25: branch_true: ...to here
nftables-1.1.5/src/netlink.c:1785:20: branch_true: following 'true' branch...
nftables-1.1.5/src/netlink.c:1786:25: branch_true: ...to here
nftables-1.1.5/src/netlink.c:1786:25: call_function: calling 'netlink_io_error' from 'netlink_delinearize_obj'
#   71|   
#   72|   	va_start(ap, fmt);
#   73|-> 	erec = erec_vcreate(EREC_ERROR, loc, fmt, ap);
#   74|   	va_end(ap);
#   75|   	erec_queue(erec, ctx->msgs);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def32]
nftables-1.1.5/src/netlink_delinearize.c:53:16: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
nftables-1.1.5/src/netlink_delinearize.c:73:13: enter_function: entry to 'netlink_set_register'
nftables-1.1.5/src/netlink_delinearize.c:78:17: call_function: calling 'netlink_error' from 'netlink_set_register'
#   51|   
#   52|   	va_start(ap, fmt);
#   53|-> 	erec = erec_vcreate(EREC_ERROR, loc, fmt, ap);
#   54|   	va_end(ap);
#   55|   	erec_queue(erec, ctx->msgs);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
nftables-1.1.5/src/nfnl_osf.c:377:21: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen("/etc/nftables/osf/pf.os", "r")'
nftables-1.1.5/src/nfnl_osf.c:355:5: enter_function: entry to 'nfnl_osf_load_fingerprints'
nftables-1.1.5/src/nfnl_osf.c:365:15: acquire_resource: opened here
nftables-1.1.5/src/nfnl_osf.c:366:12: branch_false: following 'false' branch...
nftables-1.1.5/src/nfnl_osf.c:366:12: branch_false: ...to here
nftables-1.1.5/src/nfnl_osf.c:374:16: branch_true: following 'true' branch...
nftables-1.1.5/src/nfnl_osf.c:377:21: branch_true: ...to here
nftables-1.1.5/src/nfnl_osf.c:382:20: branch_false: following 'false' branch (when 'len > 0')...
nftables-1.1.5/src/nfnl_osf.c:385:17: branch_false: ...to here
nftables-1.1.5/src/nfnl_osf.c:387:23: call_function: calling 'osf_load_line' from 'nfnl_osf_load_fingerprints'
#  375|   		int len;
#  376|   
#  377|-> 		if (buf[0] == '#' || buf[0] == '\n' || buf[0] == '\r')
#  378|   			continue;
#  379|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
nftables-1.1.5/src/nfnl_osf.c:377:21: warning[-Wanalyzer-malloc-leak]: leak of 'fopen("/etc/nftables/osf/pf.os", "r")'
nftables-1.1.5/src/nfnl_osf.c:355:5: enter_function: entry to 'nfnl_osf_load_fingerprints'
nftables-1.1.5/src/nfnl_osf.c:365:15: acquire_memory: allocated here
nftables-1.1.5/src/nfnl_osf.c:366:12: branch_false: following 'false' branch...
nftables-1.1.5/src/nfnl_osf.c:366:12: branch_false: ...to here
nftables-1.1.5/src/nfnl_osf.c:374:16: branch_true: following 'true' branch...
nftables-1.1.5/src/nfnl_osf.c:377:21: branch_true: ...to here
nftables-1.1.5/src/nfnl_osf.c:382:20: branch_false: following 'false' branch (when 'len > 0')...
nftables-1.1.5/src/nfnl_osf.c:385:17: branch_false: ...to here
nftables-1.1.5/src/nfnl_osf.c:387:23: call_function: calling 'osf_load_line' from 'nfnl_osf_load_fingerprints'
#  375|   		int len;
#  376|   
#  377|-> 		if (buf[0] == '#' || buf[0] == '\n' || buf[0] == '\r')
#  378|   			continue;
#  379|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
nftables-1.1.5/src/owner.c:65:23: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(&procname)'
nftables-1.1.5/src/owner.c:53:12: branch_false: following 'false' branch...
nftables-1.1.5/src/owner.c:56:15: branch_false: ...to here
nftables-1.1.5/src/owner.c:56:15: acquire_memory: allocated here
nftables-1.1.5/src/owner.c:57:12: branch_false: following 'false' branch...
nftables-1.1.5/src/owner.c:57:12: branch_false: ...to here
nftables-1.1.5/src/owner.c:65:23: throw: if 'readdir' throws an exception...
nftables-1.1.5/src/owner.c:65:23: danger: 'opendir(&procname)' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   63|   		ssize_t rl;
#   64|   
#   65|-> 		ent = readdir(dir);
#   66|   		if (!ent)
#   67|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
nftables-1.1.5/src/owner.c:114:23: warning[-Wanalyzer-malloc-leak]: leak of 'opendir("/proc")'
nftables-1.1.5/src/owner.c:102:12: branch_false: following 'false' branch...
nftables-1.1.5/src/owner.c:106:15: branch_false: ...to here
nftables-1.1.5/src/owner.c:106:15: acquire_memory: allocated here
nftables-1.1.5/src/owner.c:107:12: branch_false: following 'false' branch...
nftables-1.1.5/src/owner.c:107:12: branch_false: ...to here
nftables-1.1.5/src/owner.c:114:23: throw: if 'readdir' throws an exception...
nftables-1.1.5/src/owner.c:114:23: danger: 'opendir("/proc")' leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  112|   		char *end;
#  113|   
#  114|-> 		ent = readdir(dir);
#  115|   		if (!ent)
#  116|   			break;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def37]
nftables-1.1.5/src/parser_bison.c:8019:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'yyss'
nftables-1.1.5/src/parser_bison.c:7974:6: branch_true: following 'true' branch...
nftables-1.1.5/src/parser_bison.c:7980:34: branch_true: ...to here
nftables-1.1.5/src/parser_bison.c:8006:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
nftables-1.1.5/src/parser_bison.c:8008:7: branch_false: ...to here
nftables-1.1.5/src/parser_bison.c:8017:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
nftables-1.1.5/src/parser_bison.c:8017:12: branch_false: ...to here
nftables-1.1.5/src/parser_bison.c:8019:9: danger: use of uninitialized value 'yyss' here
# 8017|           if (! yyptr)
# 8018|             YYNOMEM;
# 8019|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 8020|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 8021|           YYSTACK_RELOCATE (yyls_alloc, yyls);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def38]
nftables-1.1.5/src/parser_bison.c:8150:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*<unknown>'
nftables-1.1.5/src/parser_bison.c:7974:6: branch_false: following 'false' branch...
nftables-1.1.5/src/parser_bison.c:8043:6: branch_false: ...to here
nftables-1.1.5/src/parser_bison.c:8043:6: branch_false: following 'false' branch (when 'yystate != 2')...
nftables-1.1.5/src/parser_bison.c:8046:3: branch_false: ...to here
nftables-1.1.5/src/parser_bison.c:8058:6: branch_true: following 'true' branch (when 'yyn == -1846')...
nftables-1.1.5/src/parser_bison.c:8059:5: branch_true: ...to here
nftables-1.1.5/src/parser_bison.c:8130:6: branch_false: following 'false' branch (when 'yyn != 0')...
nftables-1.1.5/src/parser_bison.c:8132:3: branch_false: ...to here
nftables-1.1.5/src/parser_bison.c:8150:3: danger: use of uninitialized value '*<unknown>' here
# 8148|        unconditionally makes the parser a bit smaller, and it avoids a
# 8149|        GCC warning that YYVAL may be used uninitialized.  */
# 8150|->   yyval = yyvsp[1-yylen];
# 8151|   
# 8152|     /* Default location. */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def39]
nftables-1.1.5/src/parser_json.c:141:16: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
nftables-1.1.5/src/parser_json.c:2972:21: enter_function: entry to 'ifname_expr_alloc'
nftables-1.1.5/src/parser_json.c:2977:12: branch_true: following 'true' branch (when 'length == 0')...
nftables-1.1.5/src/parser_json.c:2978:17: branch_true: ...to here
nftables-1.1.5/src/parser_json.c:2978:17: call_function: calling 'json_error' from 'ifname_expr_alloc'
#  139|   
#  140|   	va_start(ap, fmt);
#  141|-> 	erec = erec_vcreate(EREC_ERROR, int_loc, fmt, ap);
#  142|   	va_end(ap);
#  143|   	erec_queue(erec, ctx->msgs);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def40]
nftables-1.1.5/src/parser_json.c:170:14: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
nftables-1.1.5/src/parser_json.c:4061:20: enter_function: entry to 'json_parse_cmd_rename'
nftables-1.1.5/src/parser_json.c:4068:13: call_function: calling 'json_unpack_err' from 'json_parse_cmd_rename'
#  168|   
#  169|   	va_start(ap, fmt);
#  170|-> 	rc = json_vunpack_ex(root, &err, 0, fmt, ap);
#  171|   	va_end(ap);
#  172|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def41]
nftables-1.1.5/src/parser_json.c:3158:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'tmp'
nftables-1.1.5/src/parser_json.c:3123:20: enter_function: entry to 'json_parse_cmd_add_rule'
nftables-1.1.5/src/parser_json.c:3136:13: call_function: calling 'json_unpack_err' from 'json_parse_cmd_add_rule'
nftables-1.1.5/src/parser_json.c:3136:13: return_function: returning to 'json_parse_cmd_add_rule' from 'json_unpack_err'
nftables-1.1.5/src/parser_json.c:3136:12: branch_false: following 'false' branch...
nftables-1.1.5/src/parser_json.c:3141:12: branch_false: ...to here
nftables-1.1.5/src/parser_json.c:3142:13: call_function: calling 'json_unpack_err' from 'json_parse_cmd_add_rule'
nftables-1.1.5/src/parser_json.c:3142:13: return_function: returning to 'json_parse_cmd_add_rule' from 'json_unpack_err'
nftables-1.1.5/src/parser_json.c:3141:13: branch_false: following 'false' branch...
nftables-1.1.5/src/parser_json.c:3144:19: branch_false: ...to here
nftables-1.1.5/src/parser_json.c:3148:13: call_function: calling 'parse_family' from 'json_parse_cmd_add_rule'
nftables-1.1.5/src/parser_json.c:3148:13: return_function: returning to 'json_parse_cmd_add_rule' from 'parse_family'
nftables-1.1.5/src/parser_json.c:3148:12: branch_false: following 'false' branch...
nftables-1.1.5/src/parser_json.c:3152:24: branch_false: ...to here
nftables-1.1.5/src/parser_json.c:3155:12: branch_false: following 'false' branch...
nftables-1.1.5/src/parser_json.c:3158:14: branch_false: ...to here
nftables-1.1.5/src/parser_json.c:3158:12: danger: use of uninitialized value 'tmp' here
# 3156|   		return cmd_alloc(op, obj, &h, int_loc, NULL);
# 3157|   
# 3158|-> 	if (!json_is_array(tmp)) {
# 3159|   		json_error(ctx, "Value of property \"expr\" must be an array.");
# 3160|   		handle_free(&h);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def42]
nftables-1.1.5/src/parser_json.c:3442:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'family'
nftables-1.1.5/src/parser_json.c:3417:20: enter_function: entry to 'json_parse_cmd_add_flowtable'
nftables-1.1.5/src/parser_json.c:3427:13: call_function: calling 'json_unpack_err' from 'json_parse_cmd_add_flowtable'
nftables-1.1.5/src/parser_json.c:3427:13: return_function: returning to 'json_parse_cmd_add_flowtable' from 'json_unpack_err'
nftables-1.1.5/src/parser_json.c:3427:12: branch_false: following 'false' branch...
nftables-1.1.5/src/parser_json.c:3432:12: branch_false: ...to here
nftables-1.1.5/src/parser_json.c:3442:13: danger: use of uninitialized value 'family' here
# 3440|   	}
# 3441|   
# 3442|-> 	if (parse_family(family, &h.family)) {
# 3443|   		json_error(ctx, "Unknown family '%s'.", family);
# 3444|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def43]
nftables-1.1.5/src/parser_json.c:4330:16: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
nftables-1.1.5/src/parser_json.c:4329:9: acquire_resource: 'va_start' called here
nftables-1.1.5/src/parser_json.c:4330:16: throw: if 'erec_vcreate' throws an exception...
nftables-1.1.5/src/parser_json.c:4330:16: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 4328|   
# 4329|   	va_start(ap, fmt);
# 4330|-> 	erec = erec_vcreate(EREC_ERROR, int_loc, fmt, ap);
# 4331|   	va_end(ap);
# 4332|   	erec_queue(erec, monh->ctx->msgs);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
nftables-1.1.5/src/payload.c:882:57: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
nftables-1.1.5/src/payload.c:855:13: enter_function: entry to 'payload_may_dependency_kill'
nftables-1.1.5/src/payload.c:858:28: call_function: calling 'payload_dependency_get' from 'payload_may_dependency_kill'
nftables-1.1.5/src/payload.c:858:28: return_function: returning to 'payload_may_dependency_kill' from 'payload_dependency_get'
nftables-1.1.5/src/payload.c:882:20: branch_true: following 'true' branch...
nftables-1.1.5/src/payload.c:882:57: branch_true: ...to here
nftables-1.1.5/src/payload.c:882:57: danger: dereference of NULL 'payload_dependency_get(ctx, *expr.<U1aa0>.payload.base)'
#  880|   		 * for stacked protocols if we only have protcol type matches.
#  881|   		 */
#  882|-> 		if (dep->left->etype == EXPR_PAYLOAD && dep->op == OP_EQ &&
#  883|   		    expr->payload.base == dep->left->payload.base) {
#  884|   			if (expr->flags & EXPR_F_PROTOCOL)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
nftables-1.1.5/src/rule.c:2312:13: warning[-Wanalyzer-null-dereference]: dereference of NULL 'table'
nftables-1.1.5/src/rule.c:2621:5: enter_function: entry to 'do_command'
nftables-1.1.5/src/rule.c:2638:24: call_function: calling 'do_command_list' from 'do_command'
# 2310|   	const char *family = family2str(table->handle.family);
# 2311|   
# 2312|-> 	if (table->has_xt_stmts)
# 2313|   		fprintf(octx->error_fp,
# 2314|   			"# Warning: table %s %s is managed by iptables-nft, do not touch!\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
nftables-1.1.5/src/scanner.c:8773:54: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(64)'
nftables-1.1.5/src/scanner.c:8757:21: enter_function: entry to 'nft__create_buffer'
nftables-1.1.5/src/scanner.c:8764:31: call_function: inlined call to 'nft_alloc' from 'nft__create_buffer'
nftables-1.1.5/src/scanner.c:8765:12: branch_false: following 'false' branch...
nftables-1.1.5/src/scanner.c:8768:9: branch_false: ...to here
nftables-1.1.5/src/scanner.c:8773:54: danger: 'malloc(64)' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 8771|   	 * we need to put in 2 end-of-buffer characters.
# 8772|   	 */
# 8773|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 8774|   	if ( ! b->yy_ch_buf )
# 8775|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
nftables-1.1.5/src/scanner.c:8828:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'b'
nftables-1.1.5/src/scanner.c:8673:10: enter_function: entry to 'nft_restart'
nftables-1.1.5/src/scanner.c:8681:9: call_function: calling 'nft_ensure_buffer_stack' from 'nft_restart'
nftables-1.1.5/src/scanner.c:8681:9: return_function: returning to 'nft_restart' from 'nft_ensure_buffer_stack'
nftables-1.1.5/src/scanner.c:8683:13: call_function: calling 'nft__create_buffer' from 'nft_restart'
nftables-1.1.5/src/scanner.c:8683:13: return_function: returning to 'nft_restart' from 'nft__create_buffer'
nftables-1.1.5/src/scanner.c:8686:9: branch_false: following 'false' branch...
nftables-1.1.5/src/scanner.c:8686:9: branch_false: ...to here
nftables-1.1.5/src/scanner.c:8686:9: call_function: calling 'nft__init_buffer' from 'nft_restart'
# 8826|   
# 8827|   /* %if-c-only */
# 8828|-> 	b->yy_input_file = file;
# 8829|   /* %endif */
# 8830|   /* %if-c++-only */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
nftables-1.1.5/src/scanner.c:8977:17: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(8)'
nftables-1.1.5/src/scanner.l:1177:5: enter_function: entry to 'scanner_read_file'
nftables-1.1.5/src/scanner.l:1180:16: call_function: calling 'include_file' from 'scanner_read_file'
# 8975|   			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
# 8976|   
# 8977|-> 		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
# 8978|   
# 8979|   		yyg->yy_buffer_stack_max = num_to_alloc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
nftables-1.1.5/src/scanner.c:9053:16: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
nftables-1.1.5/src/scanner.l:1261:6: enter_function: entry to 'scanner_push_buffer'
nftables-1.1.5/src/scanner.l:1274:13: call_function: calling 'nft__scan_string' from 'scanner_push_buffer'
# 9051|   {
# 9052|       
# 9053|-> 	return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
# 9054|   }
# 9055|   /* %endif */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
nftables-1.1.5/src/scanner.c:9081:33: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(n)'
nftables-1.1.5/src/scanner.c:9065:17: enter_function: entry to 'nft__scan_bytes'
nftables-1.1.5/src/scanner.c:9074:24: call_function: inlined call to 'nft_alloc' from 'nft__scan_bytes'
nftables-1.1.5/src/scanner.c:9075:12: branch_false: following 'false' branch...
nftables-1.1.5/src/scanner.c:9075:12: branch_false: ...to here
nftables-1.1.5/src/scanner.c:9083:13: call_function: calling 'nft__scan_buffer' from 'nft__scan_bytes'
# 9079|   		buf[i] = yybytes[i];
# 9080|   
# 9081|-> 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 9082|   
# 9083|   	b = yy_scan_buffer( buf, n , yyscanner);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def51]
nftables-1.1.5/src/scanner.c:9320:5: warning[-Wanalyzer-null-dereference]: dereference of NULL 'scanner'
nftables-1.1.5/src/scanner.l:1279:7: enter_function: entry to 'scanner_init'
nftables-1.1.5/src/scanner.l:1283:9: call_function: calling 'nft_lex_init_extra' from 'scanner_init'
nftables-1.1.5/src/scanner.l:1283:9: return_function: returning to 'scanner_init' from 'nft_lex_init_extra'
nftables-1.1.5/src/scanner.l:1284:9: call_function: inlined call to 'nft_set_out' from 'scanner_init'
# 9318|   {
# 9319|       struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
# 9320|->     yyout = _out_str ;
# 9321|   }
# 9322|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
nftables-1.1.5/src/scanner.l:1276:9: warning[-Wanalyzer-malloc-leak]: leak of '<return-value>'
nftables-1.1.5/src/scanner.l:1261:6: enter_function: entry to 'scanner_push_buffer'
nftables-1.1.5/src/scanner.l:1274:13: call_function: calling 'nft__scan_string' from 'scanner_push_buffer'
nftables-1.1.5/src/scanner.l:1276:9: danger: '<return-value>' leaks here; was allocated at [(19)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/18)
# 1274|   	b = yy_scan_string(buffer, scanner);
# 1275|   	assert(b != NULL);
# 1276|-> 	init_pos(state->indesc);
# 1277|   }
# 1278|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
nftables-1.1.5/src/scanner.l:1286:35: warning[-Wanalyzer-malloc-leak]: leak of 'scanner'
nftables-1.1.5/src/scanner.l:1279:7: enter_function: entry to 'scanner_init'
nftables-1.1.5/src/scanner.l:1283:9: call_function: calling 'nft_lex_init_extra' from 'scanner_init'
nftables-1.1.5/src/scanner.l:1283:9: return_function: returning to 'scanner_init' from 'nft_lex_init_extra'
nftables-1.1.5/src/scanner.l:1286:35: throw: if 'xzalloc_array' throws an exception...
nftables-1.1.5/src/scanner.l:1286:35: danger: 'scanner' leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
# 1284|   	yyset_out(NULL, scanner);
# 1285|   
# 1286|-> 	state->startcond_active = xzalloc_array(__SC_MAX,
# 1287|   						sizeof(*state->startcond_active));
# 1288|   	return scanner;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-148.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namenftables-1.1.5-2.fc44
store-results-to/tmp/tmpguiz29rr/nftables-1.1.5-2.fc44.tar.xz
time-created2026-01-08 19:35:40
time-finished2026-01-08 19:37:52
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpguiz29rr/nftables-1.1.5-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpguiz29rr/nftables-1.1.5-2.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9