From owner-svn-src-head@freebsd.org Wed May 10 15:32:30 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 BE750D66605 for ; Wed, 10 May 2017 15:32:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 833F2329 for ; Wed, 10 May 2017 15:32:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id k91so3818002ioi.1 for ; Wed, 10 May 2017 08:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PLxXlreCVKO/0OoVWBxVoVlHyksVtRHF/85WE7jXr3w=; b=A7yuYF5N2cGXqhJY8A+VaKg/Xz6TMol6FNiYZYvVbLMhySCyrWmQLVfgb4CtntlII4 XQwq/LUeXQbGei0ENENZPbWgBGBSukZmN4JW3E/L0Ym+2bjMWRcZBCPZxlzqIQD6VD0s YQUnd1wKIeo2fUJMlCzZ5moAZY3rXwqQD9XMtEM6egwmCi4i6WN6k/eoH5DHLeZCbEvR flFts1upZv82I3lSO+Rjj0ZdiYmyQw6Z/g9TYEmivjT6MkZIKXDpDZLXCZHEKw4H8JBT D2KfXMobH7jbkC6QMI+/8JB8ktw5T9h5WZY2/AM2bMQvS36eG3Wm51NLBTcMnXuvdvge Cf1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PLxXlreCVKO/0OoVWBxVoVlHyksVtRHF/85WE7jXr3w=; b=qSP9izD3rR6NC+C154cWHqp1YnqzLouGDkfbAZqvfwOd7f7ys7H92QbcdMx+LHLA3o 9kx5yaqoqjI84KPGoDQe/BtMoNmbo1JoiucnJFVD+sI9l8l+fMDMbX38L26/1dPXq0OO mS9m8Ab9DOaxqlXSuy2KSmkN/nuDOQBcY2hiYU/5zXMsijTJYrskCVYmY00VbxWhPvjp Ddf2McsxgNvcveUXi7NQycBBiOK0VZi9GxZhwc/dTT12jCtIhfSY8t1GC+WmjRkqbknM Wyl169tz715WsS1qUIyOAvw7X3oGFa0gdN3zj16GGeOrXr/prM+9r+x+7LtIxN6F/mjI vvdA== X-Gm-Message-State: AODbwcAqHkBPP015Axw6o4BZo+Kx8XLy4MQmmNWj9tjoyVaqXsxCyTu/ HNMBXstXpQF7nX87GpnfaG7asoI7pg== X-Received: by 10.107.188.69 with SMTP id m66mr4545269iof.148.1494430349730; Wed, 10 May 2017 08:32:29 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.126.6 with HTTP; Wed, 10 May 2017 08:32:29 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:55:e5ab:afa:6971] In-Reply-To: <201705101527.v4AFRbbu005469@repo.freebsd.org> References: <201705101527.v4AFRbbu005469@repo.freebsd.org> From: Warner Losh Date: Wed, 10 May 2017 09:32:29 -0600 X-Google-Sender-Auth: B_8tofRDESDKIpNWDQ631QtX_Mw Message-ID: Subject: Re: svn commit: r318141 - head/usr.bin/mkuzip To: Alan Somers Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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: Wed, 10 May 2017 15:32:30 -0000 Doesn't assert get compiled out, which would cause strlcpy to never happen? Warner On Wed, May 10, 2017 at 9:27 AM, Alan Somers wrote: > Author: asomers > Date: Wed May 10 15:27:36 2017 > New Revision: 318141 > URL: https://svnweb.freebsd.org/changeset/base/318141 > > Log: > strcpy => strlcpy > > Reported by: Coverity > CID: 1352771 > MFC after: 3 weeks > Sponsored by: Spectra Logic Corp > > Modified: > head/usr.bin/mkuzip/mkuzip.c > > Modified: head/usr.bin/mkuzip/mkuzip.c > ============================================================================== > --- head/usr.bin/mkuzip/mkuzip.c Wed May 10 15:20:39 2017 (r318140) > +++ head/usr.bin/mkuzip/mkuzip.c Wed May 10 15:27:36 2017 (r318141) > @@ -192,7 +192,8 @@ int main(int argc, char **argv) > /* Not reached */ > } > > - strcpy(hdr.magic, cfs.handler->magic); > + assert(strlcpy(hdr.magic, cfs.handler->magic, sizeof(hdr.magic)) > + < sizeof(hdr.magic)); > > if (cfs.en_dedup != 0) { > hdr.magic[CLOOP_OFS_VERSN] = CLOOP_MAJVER_3; >