mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
libnv: correct the calculation of the structure's size
Reported by: Milosz Kaniewski <milosz.kaniewski@gmail.com>
Approved by: so
Security: FreeBSD-SA-24:16.libnv
Security: CVE-2024-45287
(cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0)
(cherry picked from commit 056c50c48b)
This commit is contained in:
parent
4f2a65ebeb
commit
c0382ed7b3
1 changed files with 1 additions and 1 deletions
|
|
@ -1029,7 +1029,7 @@ static bool
|
|||
nvlist_check_header(struct nvlist_header *nvlhdrp)
|
||||
{
|
||||
|
||||
if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) {
|
||||
if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) {
|
||||
ERRNO_SET(EINVAL);
|
||||
return (false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue