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
This commit is contained in:
Mark Johnston 2017-02-05 02:47:34 +00:00
parent 35bf9feb41
commit 9613442e83

View File

@ -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;