svn commit: r339144 - stable/11/sys/cddl/contrib/opensolaris/common/nvpair
Alexander Motin
mav at FreeBSD.org
Wed Oct 3 14:57:54 UTC 2018
Author: mav
Date: Wed Oct 3 14:57:54 2018
New Revision: 339144
URL: https://svnweb.freebsd.org/changeset/base/339144
Log:
MFC r337219: MFV r337218: 7261 nvlist code should enforce name length limit
illumos/illumos-gate at 48dd5e630c9b1773b7b10d08a3b90b6c9062d713
Reviewed by: Sebastien Roy <sebastien.roy at delphix.com>
Reviewed by: George Wilson <george.wilson at delphix.com>
Reviewed by: Robert Mustacchi <rm at joyent.com>
Approved by: Dan McDonald <danmcd at omniti.com>
Author: Matthew Ahrens <mahrens at delphix.com>
Modified:
stable/11/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Wed Oct 3 14:57:19 2018 (r339143)
+++ stable/11/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Wed Oct 3 14:57:54 2018 (r339144)
@@ -914,6 +914,8 @@ nvlist_add_common(nvlist_t *nvl, const char *name,
/* calculate sizes of the nvpair elements and the nvpair itself */
name_sz = strlen(name) + 1;
+ if (name_sz >= 1ULL << (sizeof (nvp->nvp_name_sz) * 8 - 1))
+ return (EINVAL);
nvp_sz = NVP_SIZE_CALC(name_sz, value_sz);
More information about the svn-src-all
mailing list