mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
libnv: correct the calculation of the structure's size
Reported by: Milosz Kaniewski <[email protected]> Approved by: so Security: FreeBSD-SA-24:16.libnv Security: CVE-2024-45287 (cherry picked from commit7f4731ab67) (cherry picked from commit056c50c48b)
This commit is contained in:
1 parent
ba46f11749
commit
e9d57be06e
1 file changed
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user