pf: fix overly large memcpy()

We only want to copy the labels array, we don't want to copy the counter as well.

Reported by:	CheriBSD
Event:		Kitchener-Waterloo Hackathon 202406
This commit is contained in:
Kristof Provost 2024-06-04 17:29:13 +02:00
parent 4779b16fa6
commit 84ff9e9122

View file

@ -532,7 +532,7 @@ nlattr_get_nested_pf_rule_labels(struct nlattr *nla, struct nl_pstate *npt, cons
if (error != 0)
return (error);
memcpy(target, parsed_labels.labels, sizeof(parsed_labels));
memcpy(target, parsed_labels.labels, sizeof(parsed_labels.labels));
return (0);
}