svn commit: r313266 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

Mark Johnston markj at FreeBSD.org
Sun Feb 5 02:47:35 UTC 2017


Author: markj
Date: Sun Feb  5 02:47:34 2017
New Revision: 313266
URL: https://svnweb.freebsd.org/changeset/base/313266

Log:
  Ensure that the DOF string length is divisible by 2.
  
  It is an ASCII encoding of a hexadecimal representation of the DOF file
  used to enable anonymous tracing, so its length should always be even.
  
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Sun Feb  5 02:45:35 2017	(r313265)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Sun Feb  5 02:47:34 2017	(r313266)
@@ -13346,8 +13346,11 @@ dtrace_dof_property(const char *name)
 
 	data += strlen(name) + 1; /* skip past the '=' */
 	len = eol - data;
+	if (len % 2 != 0) {
+		dtrace_dof_error(NULL, "invalid DOF encoding length");
+		goto doferr;
+	}
 	bytes = len / 2;
-
 	if (bytes < sizeof(dof_hdr_t)) {
 		dtrace_dof_error(NULL, "truncated header");
 		goto doferr;


More information about the svn-src-head mailing list