Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jul 2021 17:35:46 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 49a7d4723543 - main - pf: consistently malloc rules with M_ZERO
Message-ID:  <202107231735.16NHZkQW043516@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=49a7d47235434a300cc57b205e493988fdebf79c

commit 49a7d47235434a300cc57b205e493988fdebf79c
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-07-23 15:01:29 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2021-07-23 17:35:32 +0000

    pf: consistently malloc rules with M_ZERO
    
    Reviewed by:    kp
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/netpfil/pf/pf_ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 27e1a145f3ec..432585610aa1 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -2321,7 +2321,7 @@ DIOCADDRULENV_error:
 		struct pfioc_rule	*pr = (struct pfioc_rule *)addr;
 		struct pf_krule		*rule;
 
-		rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK);
+		rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK | M_ZERO);
 		error = pf_rule_to_krule(&pr->rule, rule);
 		if (error != 0) {
 			free(rule, M_PFRULE);
@@ -2574,7 +2574,7 @@ DIOCGETRULENV_error:
 		}
 
 		if (pcr->action != PF_CHANGE_REMOVE) {
-			newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK);
+			newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK | M_ZERO);
 			error = pf_rule_to_krule(&pcr->rule, newrule);
 			if (error != 0) {
 				free(newrule, M_PFRULE);



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