The branch stable/13 has been updated by kp:

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

commit fec383bb53859a9fd0862513fd04dc2a710537b5
Author:     Kristof Provost <[email protected]>
AuthorDate: 2023-07-26 08:30:22 +0000
Commit:     Kristof Provost <[email protected]>
CommitDate: 2023-08-02 08:41:55 +0000

    libpfct: ensure the initial allocation is large enough
    
    Ensure that we allocate enough memory for the packed nvlist, no matter
    what size hint was provided.
    
    MFC after:      1 week
    Reported by:    R. Christian McDonald <[email protected]>
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    
    (cherry picked from commit 6422599e74db4bb8b47cead46760d96601d8396a)
---
 lib/libpfctl/libpfctl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index 99ca563548c9..a095cdd1e54b 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -68,6 +68,8 @@ pfctl_do_ioctl(int dev, uint cmd, size_t size, nvlist_t **nvl)
        int ret;
 
        data = nvlist_pack(*nvl, &nvlen);
+       if (nvlen > size)
+               size = nvlen;
 
 retry:
        nv.data = malloc(size);

Reply via email to