From owner-svn-src-head@freebsd.org Mon Mar 26 21:57:45 2018 Return-Path: Delivered-To: svn-src-head@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 207B9F6EECC; Mon, 26 Mar 2018 21:57:45 +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 C310D764FE; Mon, 26 Mar 2018 21:57:44 +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 B9AAC12C4B; Mon, 26 Mar 2018 21:57:44 +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 w2QLviVk062795; Mon, 26 Mar 2018 21:57:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QLvinQ062794; Mon, 26 Mar 2018 21:57:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803262157.w2QLvinQ062794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 21:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331594 - head/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Commit-Revision: 331594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 21:57:45 -0000 Author: cem Date: Mon Mar 26 21:57:44 2018 New Revision: 331594 URL: https://svnweb.freebsd.org/changeset/base/331594 Log: libctf: Appease Coverity overrun warnings Rather than zeroing and reading into the a smaller union member the full union size, just zero and read directly into the union. No functional change intended. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Mon Mar 26 21:14:20 2018 (r331593) +++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Mon Mar 26 21:57:44 2018 (r331594) @@ -230,12 +230,12 @@ ctf_fdopen(int fd, int *errp) bzero(&ctfsect, sizeof (ctf_sect_t)); bzero(&symsect, sizeof (ctf_sect_t)); bzero(&strsect, sizeof (ctf_sect_t)); - bzero(&hdr.ctf, sizeof (hdr)); + bzero(&hdr, sizeof (hdr)); if (fstat64(fd, &st) == -1) return (ctf_set_open_errno(errp, errno)); - if ((nbytes = pread64(fd, &hdr.ctf, sizeof (hdr), 0)) <= 0) + if ((nbytes = pread64(fd, &hdr, sizeof (hdr), 0)) <= 0) return (ctf_set_open_errno(errp, nbytes < 0? errno : ECTF_FMT)); /*