From 7f4731ab67f1d3345aee6626eb83cc5ce00010f0 Mon Sep 17 00:00:00 2001 From: Mariusz Zaborski Date: Wed, 11 Sep 2024 16:43:43 +0200 Subject: [PATCH] libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski --- 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 1dc0bb8c114..00ba3b41f3a 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -1022,7 +1022,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); }