From owner-svn-src-all@freebsd.org Fri Mar 16 20:43:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CD21F4C186; Fri, 16 Mar 2018 20:43:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E75BB736B2; Fri, 16 Mar 2018 20:43:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2424B72; Fri, 16 Mar 2018 20:43:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GKhel2032655; Fri, 16 Mar 2018 20:43:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GKheIG032654; Fri, 16 Mar 2018 20:43:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803162043.w2GKheIG032654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Mar 2018 20:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331073 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 331073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 20:43:41 -0000 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",