mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 22:02:58 -04:00
pf: fix pf_nv##_array() size check
We want to set the maximum number of elements we'll accept, not the
exact number we need.
MFC after: 3 weeks
Sponsored by: Orange Business Services
(cherry picked from commit 76c8f202a4)
This commit is contained in:
parent
3938f80d5b
commit
cf0d42d1ca
1 changed files with 1 additions and 1 deletions
|
|
@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$");
|
|||
if (! nvlist_exists_number_array(nvl, name)) \
|
||||
return (EINVAL); \
|
||||
n = nvlist_get_number_array(nvl, name, &nitems); \
|
||||
if (nitems != maxelems) \
|
||||
if (nitems > maxelems) \
|
||||
return (E2BIG); \
|
||||
if (nelems != NULL) \
|
||||
*nelems = nitems; \
|
||||
|
|
|
|||
Loading…
Reference in a new issue