Page MenuHomeFreeBSD

D56342.diff
No OneTemporary

D56342.diff

diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c
--- a/sys/contrib/libnv/nvlist.c
+++ b/sys/contrib/libnv/nvlist.c
@@ -1027,10 +1027,6 @@
nvlist_check_header(struct nvlist_header *nvlhdrp)
{
- if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) {
- ERRNO_SET(EINVAL);
- return (false);
- }
if (nvlhdrp->nvlh_magic != NVLIST_HEADER_MAGIC) {
ERRNO_SET(EINVAL);
return (false);
@@ -1050,6 +1046,11 @@
nvlhdrp->nvlh_descriptors = be64toh(nvlhdrp->nvlh_descriptors);
}
#endif
+ if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) {
+ ERRNO_SET(EINVAL);
+ return (false);
+ }
+
return (true);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 20, 7:51 AM (11 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31282141
Default Alt Text
D56342.diff (641 B)

Event Timeline