git: d84fced6b468 - stable/13 - libnv: correct the calculation of the structure's size
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 15 Sep 2024 15:00:03 UTC
The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d84fced6b468a637b5a47bad747730fa344d68d8 commit d84fced6b468a637b5a47bad747730fa344d68d8 Author: Mariusz Zaborski <oshogbo@FreeBSD.org> AuthorDate: 2024-09-11 14:43:43 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-09-15 14:59:51 +0000 libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski <milosz.kaniewski@gmail.com> (cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0) (cherry picked from commit 056c50c48be3e3828ef740d2fcce988a545e52aa) --- sys/contrib/libnv/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }