Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Sep 2023 21:57:00 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f9c32827759b - stable/12 - libpfctl: Don't pass stack garbage to free.
Message-ID:  <202309062157.386Lv08g023619@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by jhb:

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

commit f9c32827759b2e1dda97d91f69d70673f5c9393b
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-03-22 19:33:59 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-09-06 20:02:00 +0000

    libpfctl: Don't pass stack garbage to free.
    
    GCC 9 on stable/12 reports a -Wmaybe-uninitialized error for the call
    to free in _pfctl_clear_states.
    
    Reviewed by:    mjg
    Differential Revision:  https://reviews.freebsd.org/D39198
    
    (cherry picked from commit 48c519be0e8005aedc817b1bc1101ad32b67a67a)
---
 lib/libpfctl/libpfctl.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index a095cdd1e54b..8917ee166473 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -923,7 +923,6 @@ static int
 _pfctl_clear_states(int dev, const struct pfctl_kill *kill,
     unsigned int *killed, uint64_t ioctlval)
 {
-	struct pfioc_nv	 nv;
 	nvlist_t	*nvl;
 	int		 ret;
 
@@ -946,7 +945,6 @@ _pfctl_clear_states(int dev, const struct pfctl_kill *kill,
 		*killed = nvlist_get_number(nvl, "killed");
 
 	nvlist_destroy(nvl);
-	free(nv.data);
 
 	return (ret);
 }



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