Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Feb 2017 02:47:34 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313266 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace
Message-ID:  <201702050247.v152lYkC018495@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702050247.v152lYkC018495>