aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2024-09-11 14:43:43 +0000
committerGordon Tetlow <gordon@FreeBSD.org>2024-09-19 13:34:07 +0000
commit2cffa6354d9f9180b865a5bc210ab78f9f8ec00b (patch)
tree9e806d93db6702f9510b14c76398e88914c1bd16
parent5f035df278ccb4ac0b87ad38eb5dc20b8dfbf48e (diff)
libnv: correct the calculation of the structure's size
Reported by: Milosz Kaniewski <milosz.kaniewski@gmail.com> Approved by: so Approved by: re (cperciva) Security: FreeBSD-SA-24:16.libnv Security: CVE-2024-45287 (cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0) (cherry picked from commit 056c50c48be3e3828ef740d2fcce988a545e52aa) (cherry picked from commit d84fced6b468a637b5a47bad747730fa344d68d8)
-rw-r--r--sys/contrib/libnv/nvlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c
index e399d610a7ce..6934da0df00a 100644
--- a/sys/contrib/libnv/nvlist.c
+++ b/sys/contrib/libnv/nvlist.c
@@ -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);
}