From owner-svn-src-head@freebsd.org Mon Apr 10 19:22:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89FC7D37D8D; Mon, 10 Apr 2017 19:22:16 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 56FC71C8; Mon, 10 Apr 2017 19:22:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3AJMF67001218; Mon, 10 Apr 2017 19:22:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3AJMFEK001217; Mon, 10 Apr 2017 19:22:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704101922.v3AJMFEK001217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 10 Apr 2017 19:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316685 - head/contrib/elftoolchain/libelf X-SVN-Group: head 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.23 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, 10 Apr 2017 19:22:16 -0000 Author: emaste Date: Mon Apr 10 19:22:15 2017 New Revision: 316685 URL: https://svnweb.freebsd.org/changeset/base/316685 Log: libelf: add an assert that msz is non-zero Reported by: Coverity CID: 976023 Modified: head/contrib/elftoolchain/libelf/elf_update.c Modified: head/contrib/elftoolchain/libelf/elf_update.c ============================================================================== --- head/contrib/elftoolchain/libelf/elf_update.c Mon Apr 10 18:21:30 2017 (r316684) +++ head/contrib/elftoolchain/libelf/elf_update.c Mon Apr 10 19:22:15 2017 (r316685) @@ -808,6 +808,7 @@ _libelf_write_scn(Elf *e, unsigned char assert(d->d_buf != NULL); assert(d->d_version == e->e_version); + assert(msz != 0); assert(d->d_size % msz == 0); nobjects = (size_t) (d->d_size / msz);