From owner-svn-src-head@freebsd.org Thu Jul 16 22:22:49 2015 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 A3CC19A4414 for ; Thu, 16 Jul 2015 22:22:49 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) by mx1.freebsd.org (Postfix) with SMTP id 7CD1212FE for ; Thu, 16 Jul 2015 22:22:49 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 16 Jul 2015 22:21:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t6GMMkhR054834; Thu, 16 Jul 2015 16:22:46 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1437085366.1334.367.camel@freebsd.org> Subject: Re: svn commit: r285644 - head/contrib/sqlite3 From: Ian Lepore To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 16 Jul 2015 16:22:46 -0600 In-Reply-To: <201507162207.t6GM7ECT009955@repo.freebsd.org> References: <201507162207.t6GM7ECT009955@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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: Thu, 16 Jul 2015 22:22:49 -0000 On Thu, 2015-07-16 at 22:07 +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Jul 16 22:07:13 2015 > New Revision: 285644 > URL: https://svnweb.freebsd.org/changeset/base/285644 > > Log: > sqlite: clean a couple of invocations of memcpy(3) > > Found almost accidentally by our native gcc when enhanced with > FORTIFY_SOURCE. > > Submitted by: Oliver Pinter > Sponosored by: Google Inc. GSoC 2015 > > Modified: > head/contrib/sqlite3/sqlite3.c > > Modified: head/contrib/sqlite3/sqlite3.c > ============================================================================== > --- head/contrib/sqlite3/sqlite3.c Thu Jul 16 19:40:18 2015 (r285643) > +++ head/contrib/sqlite3/sqlite3.c Thu Jul 16 22:07:13 2015 (r285644) > @@ -49487,9 +49487,9 @@ static void walIndexWriteHdr(Wal *pWal){ > pWal->hdr.isInit = 1; > pWal->hdr.iVersion = WALINDEX_MAX_VERSION; > walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum); > - memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr)); > + memcpy((void *)&aHdr[1], (const void *)&pWal->hdr, sizeof(WalIndexHdr)); > walShmBarrier(pWal); > - memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr)); > + memcpy((void *)&aHdr[0], (const void *)&pWal->hdr, sizeof(WalIndexHdr)); > } > > /* > Setting aside any "unnecessary divergence with upstream" questions for the moment, wouldn't the correct fix be to just remove the casting completely? -- Ian