Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2024 08:37:27 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 88f557a2a9c3 - main - libpfctl: fix incorrect labels copy
Message-ID:  <202403220837.42M8bRMI094247@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=88f557a2a9c31aaa954841b06d38eec84a1702fc

commit 88f557a2a9c31aaa954841b06d38eec84a1702fc
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-03-22 03:21:50 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-03-22 08:00:05 +0000

    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
---
 lib/libpfctl/libpfctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index e732c8eef854..076cfd3400e6 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403220837.42M8bRMI094247>