libdtrace: Eliminate a minor UB by fully initializing parameter struct

The dtt_flags value is dereferenced by dt_type_pointer() and must be
initialized first.

Reported by:	Coverity
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Conrad Meyer 2018-03-16 20:43:40 +00:00
parent db488e4f52
commit 1ad2da031e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=331073

View File

@ -3069,9 +3069,10 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
"cannot take address of bit-field\n");
}
dtt.dtt_object = NULL;
dtt.dtt_ctfp = cp->dn_ctfp;
dtt.dtt_type = cp->dn_type;
dtt = (dtrace_typeinfo_t){
.dtt_ctfp = cp->dn_ctfp,
.dtt_type = cp->dn_type,
};
if (dt_type_pointer(&dtt) == -1) {
xyerror(D_TYPE_ERR, "cannot find type for \"&\": %s*\n",