Skip to content

Commit

Permalink
pf: fix overly large memcpy()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kprovost committed Jun 4, 2024
1 parent 4779b16 commit 84ff9e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/netpfil/pf/pf_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 84ff9e9

Please sign in to comment.