libnftnl-1.2.8-2.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libnftnl-1.2.8-build/libnftnl-1.2.8/include/linux_list.h:83:20: warning[-Wanalyzer-malloc-leak]: leak of 'nftnl_set_elem_alloc()'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set_elem.c: scope_hint: In function 'nftnl_set_elems_parse2'
libnftnl-1.2.8-build/libnftnl-1.2.8/include/linux_list.h:67:24: note: in definition of macro 'INIT_LIST_HEAD'
#   81|   	new->next = next;
#   82|   	new->prev = prev;
#   83|-> 	prev->next = new;
#   84|   }
#   85|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def2]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c: scope_hint: In function 'nftnl_chain_set_data'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:229:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/include/internal.h:7: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:11: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:229:17: note: read of 3 bytes from after the end of 'data'
#  227|   					  attr, data, data_len);
#  228|   	case NFTNL_CHAIN_HOOKNUM:
#  229|-> 		memcpy(&c->hooknum, data, sizeof(c->hooknum));
#  230|   		break;
#  231|   	case NFTNL_CHAIN_PRIO:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def3]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:232:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:232:17: note: read of 3 bytes from after the end of 'data'
#  230|   		break;
#  231|   	case NFTNL_CHAIN_PRIO:
#  232|-> 		memcpy(&c->prio, data, sizeof(c->prio));
#  233|   		break;
#  234|   	case NFTNL_CHAIN_POLICY:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def4]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:235:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:235:17: note: read of 3 bytes from after the end of 'data'
#  233|   		break;
#  234|   	case NFTNL_CHAIN_POLICY:
#  235|-> 		memcpy(&c->policy, data, sizeof(c->policy));
#  236|   		break;
#  237|   	case NFTNL_CHAIN_USE:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def5]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:238:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:238:17: note: read of 3 bytes from after the end of 'data'
#  236|   		break;
#  237|   	case NFTNL_CHAIN_USE:
#  238|-> 		memcpy(&c->use, data, sizeof(c->use));
#  239|   		break;
#  240|   	case NFTNL_CHAIN_BYTES:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def6]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:241:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:241:17: note: read of 7 bytes from after the end of 'data'
#  239|   		break;
#  240|   	case NFTNL_CHAIN_BYTES:
#  241|-> 		memcpy(&c->bytes, data, sizeof(c->bytes));
#  242|   		break;
#  243|   	case NFTNL_CHAIN_PACKETS:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def7]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:244:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:244:17: note: read of 7 bytes from after the end of 'data'
#  242|   		break;
#  243|   	case NFTNL_CHAIN_PACKETS:
#  244|-> 		memcpy(&c->packets, data, sizeof(c->packets));
#  245|   		break;
#  246|   	case NFTNL_CHAIN_HANDLE:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def8]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:247:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:247:17: note: read of 7 bytes from after the end of 'data'
#  245|   		break;
#  246|   	case NFTNL_CHAIN_HANDLE:
#  247|-> 		memcpy(&c->handle, data, sizeof(c->handle));
#  248|   		break;
#  249|   	case NFTNL_CHAIN_FAMILY:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def9]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:250:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:250:17: note: read of 3 bytes from after the end of 'data'
#  248|   		break;
#  249|   	case NFTNL_CHAIN_FAMILY:
#  250|-> 		memcpy(&c->family, data, sizeof(c->family));
#  251|   		break;
#  252|   	case NFTNL_CHAIN_TYPE:

Error: GCC_ANALYZER_WARNING (CWE-131): [#def10]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:260:33: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
#  258|   	case NFTNL_CHAIN_DEVICES:
#  259|   		dev_array = (const char **)data;
#  260|-> 		while (dev_array[len] != NULL)
#  261|   			len++;
#  262|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def11]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:260:33: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:260:33: note: read of 4 bytes from after the end of 'data'
#  258|   	case NFTNL_CHAIN_DEVICES:
#  259|   		dev_array = (const char **)data;
#  260|-> 		while (dev_array[len] != NULL)
#  261|   			len++;
#  262|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def12]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:274:43: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:274:43: note: read of 4 bytes from after the end of 'data'
#  272|   
#  273|   		for (i = 0; i < len; i++)
#  274|-> 			c->dev_array[i] = strdup(dev_array[i]);
#  275|   
#  276|   		c->dev_array_len = len;

Error: GCC_ANALYZER_WARNING (CWE-131): [#def13]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:274:59: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
#  272|   
#  273|   		for (i = 0; i < len; i++)
#  274|-> 			c->dev_array[i] = strdup(dev_array[i]);
#  275|   
#  276|   		c->dev_array_len = len;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def14]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:279:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:279:17: note: read of 3 bytes from after the end of 'data'
#  277|   		break;
#  278|   	case NFTNL_CHAIN_FLAGS:
#  279|-> 		memcpy(&c->chain_flags, data, sizeof(c->chain_flags));
#  280|   		break;
#  281|   	case NFTNL_CHAIN_ID:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def15]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:282:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:219:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:282:17: note: read of 3 bytes from after the end of 'data'
#  280|   		break;
#  281|   	case NFTNL_CHAIN_ID:
#  282|-> 		memcpy(&c->chain_id, data, sizeof(c->chain_id));
#  283|   		break;
#  284|   	case NFTNL_CHAIN_USERDATA:

Error: CPPCHECK_WARNING (CWE-457): [#def16]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/chain.c:1106: error[uninitvar]: Uninitialized variable: c
# 1104|   
# 1105|   	hlist_for_each_entry(c, n, &chain_list->name_hash[key], hnode) {
# 1106|-> 		if (!strcmp(chain, c->name))
# 1107|   			return c;
# 1108|   	}

Error: CPPCHECK_WARNING (CWE-758): [#def17]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/expr/data_reg.c:148: error[overlappingWriteUnion]: Overlapping read/write of union is undefined behavior
#  146|   		if (type)
#  147|   			*type = DATA_VERDICT;
#  148|-> 		data->len = sizeof(data->verdict);
#  149|   		break;
#  150|   	case NFT_JUMP:

Error: GCC_ANALYZER_WARNING (CWE-131): [#def18]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:139:33: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
#  137|   	case NFTNL_FLOWTABLE_DEVICES:
#  138|   		dev_array = (const char **)data;
#  139|-> 		while (dev_array[len] != NULL)
#  140|   			len++;
#  141|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def19]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c: scope_hint: In function 'nftnl_flowtable_set_data'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:139:33: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/include/internal.h:7: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:1: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:139:33: note: read of 4 bytes from after the end of 'data'
#  137|   	case NFTNL_FLOWTABLE_DEVICES:
#  138|   		dev_array = (const char **)data;
#  139|-> 		while (dev_array[len] != NULL)
#  140|   			len++;
#  141|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def20]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:153:43: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:153:43: note: read of 4 bytes from after the end of 'data'
#  151|   
#  152|   		for (i = 0; i < len; i++)
#  153|-> 			c->dev_array[i] = strdup(dev_array[i]);
#  154|   
#  155|   		c->dev_array_len = len;

Error: GCC_ANALYZER_WARNING (CWE-131): [#def21]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:153:59: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
#  151|   
#  152|   		for (i = 0; i < len; i++)
#  153|-> 			c->dev_array[i] = strdup(dev_array[i]);
#  154|   
#  155|   		c->dev_array_len = len;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def22]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:164:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:118:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/flowtable.c:164:17: note: read of 4 bytes from after the end of 'data'
#  162|   		break;
#  163|   	case NFTNL_FLOWTABLE_HANDLE:
#  164|-> 		memcpy(&c->handle, data, sizeof(c->handle));
#  165|   		break;
#  166|   	}

Error: GCC_ANALYZER_WARNING (CWE-126): [#def23]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c: scope_hint: In function 'nftnl_obj_set_data'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:123:28: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/include/internal.h:7: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:9: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:123:28: note: read of 2 bytes from after the end of 'val'
#  121|   					  attr, data, data_len);
#  122|   	case NFTNL_OBJ_TYPE:
#  123|-> 		obj->ops = nftnl_obj_ops_lookup(*((uint32_t *)data));
#  124|   		if (!obj->ops)
#  125|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def24]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:128:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:128:17: note: read of 2 bytes from after the end of 'val'
#  126|   		break;
#  127|   	case NFTNL_OBJ_FAMILY:
#  128|-> 		memcpy(&obj->family, data, sizeof(obj->family));
#  129|   		break;
#  130|   	case NFTNL_OBJ_USE:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def25]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:131:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:131:17: note: read of 2 bytes from after the end of 'val'
#  129|   		break;
#  130|   	case NFTNL_OBJ_USE:
#  131|-> 		memcpy(&obj->use, data, sizeof(obj->use));
#  132|   		break;
#  133|   	case NFTNL_OBJ_HANDLE:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def26]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:134:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:112:17: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/object.c:134:17: note: read of 6 bytes from after the end of 'val'
#  132|   		break;
#  133|   	case NFTNL_OBJ_HANDLE:
#  134|-> 		memcpy(&obj->handle, data, sizeof(obj->handle));
#  135|   		break;
#  136|   	case NFTNL_OBJ_USERDATA:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def27]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c: scope_hint: In function 'nftnl_rule_set_data'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:124:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/include/internal.h:7: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:11: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:114:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:114:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:124:17: note: read of 4 bytes from after the end of 'val'
#  122|   					  attr, data, data_len);
#  123|   	case NFTNL_RULE_HANDLE:
#  124|-> 		memcpy(&r->handle, data, sizeof(r->handle));
#  125|   		break;
#  126|   	case NFTNL_RULE_COMPAT_PROTO:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def28]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:136:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:114:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:114:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/rule.c:136:17: note: read of 4 bytes from after the end of 'val'
#  134|   		break;
#  135|   	case NFTNL_RULE_POSITION:
#  136|-> 		memcpy(&r->position, data, sizeof(r->position));
#  137|   		break;
#  138|   	case NFTNL_RULE_USERDATA:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def29]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c: scope_hint: In function 'nftnl_set_set_data'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:155:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/include/internal.h:7: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:11: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:145:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:145:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:155:17: note: read of 4 bytes from after the end of 'val'
#  153|   					  attr, data, data_len);
#  154|   	case NFTNL_SET_HANDLE:
#  155|-> 		memcpy(&s->handle, data, sizeof(s->handle));
#  156|   		break;
#  157|   	case NFTNL_SET_FLAGS:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def30]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:198:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:145:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:145:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:198:17: note: read of 4 bytes from after the end of 'val'
#  196|   		break;
#  197|   	case NFTNL_SET_TIMEOUT:
#  198|-> 		memcpy(&s->timeout, data, sizeof(s->timeout));
#  199|   		break;
#  200|   	case NFTNL_SET_GC_INTERVAL:

Error: CPPCHECK_WARNING (CWE-457): [#def31]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set.c:1031: error[uninitvar]: Uninitialized variable: s
# 1029|   
# 1030|   	hlist_for_each_entry(s, n, &set_list->name_hash[key], hnode) {
# 1031|-> 		if (!strcmp(set, s->name))
# 1032|   			return s;
# 1033|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def32]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set_elem.c: scope_hint: In function 'nftnl_set_elem_get_u32'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set_elem.c:265:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  263|   	uint32_t size, val;
#  264|   
#  265|-> 	memcpy(&val, nftnl_set_elem_get(s, attr, &size), sizeof(val));
#  266|   
#  267|   	return val;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def33]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set_elem.c: scope_hint: In function 'nftnl_set_elem_get_u64'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/set_elem.c:276:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  274|   	uint64_t val;
#  275|   
#  276|-> 	memcpy(&val, nftnl_set_elem_get(s, attr, &size), sizeof(val));
#  277|   
#  278|   	return val;

Error: GCC_ANALYZER_WARNING (CWE-126): [#def34]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c: scope_hint: In function 'nftnl_table_set_data'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:110:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/include/internal.h:7: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:11: included_from: Included from here.
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:110:17: note: read of 4 bytes from after the end of 'val'
#  108|   					  attr, data, data_len);
#  109|   	case NFTNL_TABLE_HANDLE:
#  110|-> 		memcpy(&t->handle, data, sizeof(t->handle));
#  111|   		break;
#  112|   	case NFTNL_TABLE_FLAGS:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def35]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:113:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:113:17: note: read of 3 bytes from after the end of 'val'
#  111|   		break;
#  112|   	case NFTNL_TABLE_FLAGS:
#  113|-> 		memcpy(&t->table_flags, data, sizeof(t->table_flags));
#  114|   		break;
#  115|   	case NFTNL_TABLE_FAMILY:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def36]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:116:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:116:17: note: read of 3 bytes from after the end of 'val'
#  114|   		break;
#  115|   	case NFTNL_TABLE_FAMILY:
#  116|-> 		memcpy(&t->family, data, sizeof(t->family));
#  117|   		break;
#  118|   	case NFTNL_TABLE_USE:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def37]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:119:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:119:17: note: read of 3 bytes from after the end of 'val'
#  117|   		break;
#  118|   	case NFTNL_TABLE_USE:
#  119|-> 		memcpy(&t->use, data, sizeof(t->use));
#  120|   		break;
#  121|   	case NFTNL_TABLE_USERDATA:

Error: GCC_ANALYZER_WARNING (CWE-126): [#def38]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:132:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:103:9: note: in expansion of macro 'nftnl_assert_validate'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/table.c:132:17: note: read of 3 bytes from after the end of 'val'
#  130|   		break;
#  131|   	case NFTNL_TABLE_OWNER:
#  132|-> 		memcpy(&t->owner, data, sizeof(t->owner));
#  133|   		break;
#  134|   	}

Error: CPPCHECK_WARNING (CWE-476): [#def39]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/udata.c:89: warning[nullPointer]: Possible null pointer dereference: value
#   87|   	attr->len  = len;
#   88|   	attr->type = type;
#   89|-> 	memcpy(attr->value, value, len);
#   90|   
#   91|   	buf->end = (char *)nftnl_udata_next(attr);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def40]
libnftnl-1.2.8-build/libnftnl-1.2.8/src/udata.c: scope_hint: In function 'nftnl_udata_put'
libnftnl-1.2.8-build/libnftnl-1.2.8/src/udata.c:89:9: warning[-Wanalyzer-null-argument]: use of NULL 'value' where non-null expected
libnftnl-1.2.8-build/libnftnl-1.2.8/src/udata.c: scope_hint: In function 'nftnl_udata_put'
<built-in>: note: argument 2 of '__builtin_memcpy' must be non-null
#   87|   	attr->len  = len;
#   88|   	attr->type = type;
#   89|-> 	memcpy(attr->value, value, len);
#   90|   
#   91|   	buf->end = (char *)nftnl_udata_next(attr);

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-249.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibnftnl-1.2.8-2.fc42
store-results-to/tmp/tmpuifvnagr/libnftnl-1.2.8-2.fc42.tar.xz
time-created2024-11-13 01:38:37
time-finished2024-11-13 01:40:12
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpuifvnagr/libnftnl-1.2.8-2.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpuifvnagr/libnftnl-1.2.8-2.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9