Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jun 2024 17:44:55 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: 84ff9e9122ac - main - pf: fix overly large memcpy()
Message-ID:  <202406041744.454Hitud037102@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=84ff9e9122acf23252680784724d6d565e734d31

commit 84ff9e9122acf23252680784724d6d565e734d31
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-06-04 15:29:13 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-06-04 17:44:20 +0000

    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
---
 sys/netpfil/pf/pf_nl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c
index 1074c561cd15..cf5146c716c6 100644
--- a/sys/netpfil/pf/pf_nl.c
+++ b/sys/netpfil/pf/pf_nl.c
@@ -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);
 }



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