libpfctl: fix incorrect labels copy

We copied the entire parsed_labels struct, including the counter to a
field that was only big enough for the labels (so not the counter).

PR:		277875
MFC after:	1 week
This commit is contained in:
Kristof Provost 2024-03-22 04:21:50 +01:00
parent e08b44339b
commit 88f557a2a9

View file

@ -1297,7 +1297,7 @@ snl_attr_get_nested_pf_rule_labels(struct snl_state *ss, struct nlattr *nla,
if (! error)
return (error);
memcpy(target, parsed_labels.labels, sizeof(parsed_labels));
memcpy(target, parsed_labels.labels, sizeof(parsed_labels.labels));
return (true);
}