diff options
| author | Mariusz Zaborski <oshogbo@FreeBSD.org> | 2024-09-11 14:43:43 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2024-09-15 14:59:15 +0000 |
| commit | 056c50c48be3e3828ef740d2fcce988a545e52aa (patch) | |
| tree | 39d259232c23fa254a90ed16789c6a35b7cd5b89 | |
| parent | 048132192698865914e07c899898861b2b24d676 (diff) | |
libnv: correct the calculation of the structure's size
Reported by: Milosz Kaniewski <milosz.kaniewski@gmail.com>
(cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0)
| -rw-r--r-- | sys/contrib/libnv/nvlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 64078b10973e..92d6e655876a 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); } |
