diff options
author | Mark Johnston <markj@FreeBSD.org> | 2017-02-05 02:47:34 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2017-02-05 02:47:34 +0000 |
commit | 9613442e8388c66a89997769bc09af94b64e77cb (patch) | |
tree | 5e4cc71ac7ff77def2793228a099214b8a4585a6 /sys/cddl/contrib/opensolaris/uts/common/dtrace | |
parent | 35bf9feb41b731dec8c1e01634926320a9605865 (diff) | |
download | src-9613442e8388c66a89997769bc09af94b64e77cb.tar.gz src-9613442e8388c66a89997769bc09af94b64e77cb.zip |
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
Notes
Notes:
svn path=/head/; revision=313266
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/dtrace')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 323eaa33525b..c37af1a8307c 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -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; |