Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Mar 2018 21:10:36 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331076 - head/cddl/contrib/opensolaris/lib/libdtrace/common
Message-ID:  <201803162110.w2GLAa4j043860@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Fri Mar 16 21:10:36 2018
New Revision: 331076
URL: https://svnweb.freebsd.org/changeset/base/331076

Log:
  libdtrace: Fix another uninitialized dtt_flags UB
  
  Like r331073, eliminate a UB by fully initializing the struct with a designated
  initializer.  Note that the similar src_dtt is not fully used, so a similar
  treatment was not absolutely required.  I chose to leave it alone.  It
  wouldn't hurt to do the same thing, though.
  
  Reported by:	Coverity
  Sponsored by:	Dell EMC Isilon

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

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c	Fri Mar 16 21:03:54 2018	(r331075)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c	Fri Mar 16 21:10:36 2018	(r331076)
@@ -343,9 +343,11 @@ out:
 	src_dtt.dtt_ctfp = src_ctfp;
 	src_dtt.dtt_type = src_type;
 
-	dst_dtt.dtt_object = dt_module_lookup_by_ctf(dtp, dst_ctfp)->dm_name;
-	dst_dtt.dtt_ctfp = dst_ctfp;
-	dst_dtt.dtt_type = dst_type;
+	dst_dtt = (dtrace_typeinfo_t){
+		.dtt_object = dt_module_lookup_by_ctf(dtp, dst_ctfp)->dm_name,
+		.dtt_ctfp = dst_ctfp,
+		.dtt_type = dst_type,
+	};
 
 	return (dt_xlator_create(dtp, &src_dtt, &dst_dtt, NULL, NULL, NULL));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803162110.w2GLAa4j043860>