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 <rcm@rcm.sh> Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
parent
a98a0090b2
commit
6422599e74
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user