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:
cem 2018-03-16 20:43:40 +00:00
parent d9759abd65
commit 70e7a948b0

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",