From owner-svn-src-head@freebsd.org Wed May 10 16:23:32 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 66780D67FF0 for ; Wed, 10 May 2017 16:23:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (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 2745F1575 for ; Wed, 10 May 2017 16:23:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id o12so4857678iod.3 for ; Wed, 10 May 2017 09:23:32 -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=xlF6aVHF1YKY8cBF3LIMC8z+kuQR8yWZnAa3+H0OPsA=; b=e3tRXNWItzTC7i/I7fT/L/0vDS3Z5mdDkvzMDuBZxrq+3I9Hom4HdRdnKOzlQi8EBv fPM1VVBB74JuWEasjG1MVD1RYl0SCSjimzvAb4QHwovBcgacHDyNkuLfI5QfClNZSs6C uZAEYyR8l8qJisxZYuhTLsW6TGWM2w80jK77rSlbzkF70SFXdhcedFisI3k+BE1I//8j YGpj7/DcampJTBfz3pHQ2LvdNP6fnLTvRf9GsEdOB+4isfJ1tquLj7ACBa3rTbwjzlXA O9wzlyWU9YcuBdpIqGo1bbq31PcciP3h3pP2VHBx2ocMvFnUp8tLhdDLdFLCtiiYwa61 jFxw== 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=xlF6aVHF1YKY8cBF3LIMC8z+kuQR8yWZnAa3+H0OPsA=; b=HRZ2lzPPhLlb6aFsyjtJHz1+pFL1r1zCd5dKraXZL1llDeKoyAWyk3jEPS0VG7SI2p tHqUtraI5BB/Ouh5NdNXfsgKg1TRtAO7fuIwshxdAndYqeDEgzVVqMmWFG+yA2kiuczp YkGyUxdCI9m+Qaw9R/KUXKw3p0L4xnpQTX2wMbGHymo3sZGxaMiQ0ESSZim+sYSbgfAF QuNqa1xuGW2DXSBJ2LyPSMPpqNCZS0q2M/cehiovUAKAQfG3benCudub7MVbRDqg0EAF pyA6UXgPW9mSkjc9/pt3fnU1jqEv+N/gndQZX4Se82ADULe9obsG2nRgq3z0k27TVSOb DwAQ== X-Gm-Message-State: AODbwcBm5BXP3u8o6y6dkIoXcJhSWEae+pyRx6AjirT6+gzpGI6ZNgHb cuLn1U7hcfUfhU+ZGEXmCa7Us6TVdQ== X-Received: by 10.107.85.4 with SMTP id j4mr4297048iob.218.1494433411299; Wed, 10 May 2017 09:23:31 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.126.6 with HTTP; Wed, 10 May 2017 09:23:30 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:4c5d:3029:c8d8:ae82] In-Reply-To: <201705101606.v4AG6M4i021690@repo.freebsd.org> References: <201705101606.v4AG6M4i021690@repo.freebsd.org> From: Warner Losh Date: Wed, 10 May 2017 10:23:30 -0600 X-Google-Sender-Auth: 2svVExrqBxPpN4WqFW6FhBCHT20 Message-ID: Subject: Re: svn commit: r318144 - in head: usr.bin/mkuzip usr.sbin/pw 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 16:23:32 -0000 On Wed, May 10, 2017 at 10:06 AM, Alan Somers wrote: > Author: asomers > Date: Wed May 10 16:06:22 2017 > New Revision: 318144 > URL: https://svnweb.freebsd.org/changeset/base/318144 > > Log: > Don't depend on assert(3) getting evaluated Thanks! You can ignore my other grump. I unwisely didn't read all my inbox. Warner > Reported by: imp > MFC after: 3 weeks > X-MFC-With: 318141, 318143 > Sponsored by: Spectra Logic Corp > > Modified: > head/usr.bin/mkuzip/mkuzip.c > head/usr.sbin/pw/pw_user.c > > Modified: head/usr.bin/mkuzip/mkuzip.c > ============================================================================== > --- head/usr.bin/mkuzip/mkuzip.c Wed May 10 15:38:06 2017 (r318143) > +++ head/usr.bin/mkuzip/mkuzip.c Wed May 10 16:06:22 2017 (r318144) > @@ -108,7 +108,7 @@ int main(int argc, char **argv) > struct mkuz_conveyor *cvp; > void *c_ctx; > struct mkuz_blk_info *chit; > - size_t ncpusz, ncpu; > + size_t ncpusz, ncpu, magiclen; > double st, et; > > st = getdtime(); > @@ -192,8 +192,8 @@ int main(int argc, char **argv) > /* Not reached */ > } > > - assert(strlcpy(hdr.magic, cfs.handler->magic, sizeof(hdr.magic)) > - < sizeof(hdr.magic)); > + magiclen = strlcpy(hdr.magic, cfs.handler->magic, sizeof(hdr.magic)); > + assert(magiclen < sizeof(hdr.magic)); > > if (cfs.en_dedup != 0) { > hdr.magic[CLOOP_OFS_VERSN] = CLOOP_MAJVER_3; > > Modified: head/usr.sbin/pw/pw_user.c > ============================================================================== > --- head/usr.sbin/pw/pw_user.c Wed May 10 15:38:06 2017 (r318143) > +++ head/usr.sbin/pw/pw_user.c Wed May 10 16:06:22 2017 (r318144) > @@ -491,6 +491,7 @@ pw_pwcrypt(char *password) > char salt[SALTSIZE + 1]; > char *cryptpw; > static char buf[256]; > + size_t pwlen; > > /* > * Calculate a salt value > @@ -502,7 +503,8 @@ pw_pwcrypt(char *password) > cryptpw = crypt(password, salt); > if (cryptpw == NULL) > errx(EX_CONFIG, "crypt(3) failure"); > - assert(strlcpy(buf, cryptpw, sizeof(buf)) < sizeof(buf)); > + pwlen = strlcpy(buf, cryptpw, sizeof(buf)); > + assert(pwlen < sizeof(buf)); > return (buf); > } > >