Author: cem
Date: Fri Mar 16 20:43:40 2018
New Revision: 331073
URL: https://svnweb.freebsd.org/changeset/base/331073

Log:
  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

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c      Fri Mar 
16 20:04:52 2018        (r331072)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c      Fri Mar 
16 20:43:40 2018        (r331073)
@@ -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",
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to