From owner-freebsd-audit Wed Jul 18 15:47:46 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id A7D0037B403 for ; Wed, 18 Jul 2001 15:47:43 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f6IMlfD19812; Wed, 18 Jul 2001 18:47:41 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20010718145258.1d829df6.david@phobia.ms> References: <20010718145258.1d829df6.david@phobia.ms> Date: Wed, 18 Jul 2001 18:47:39 -0400 To: David Hill , audit@FreeBSD.ORG From: Garance A Drosihn Subject: Re: strlcpy patches Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 2:52 PM -0400 7/18/01, David Hill wrote: >I have patched some source files replacing: > > strncpy(dst, src, sizeof(dst) - 1); > dst[sizeof(dst)-1] = '\0'; > >with > > strlcpy(dst, src, sizeof dst); > >They are located at http://www.phobia.ms/patches > >What are your thoughts? Speaking only wrt usr.sbin/lpr, I have been working on doing like this sometime soon. In fact, I would have finished it last weekend except that I got sidetracked while working on some of my other lpr changes. However, I don't much like changing strncpy(...) to (void)strlcpy(...) Some of the str*cpy() calls also need to be changed for other reasons, as I remember, so I'll want to look this over more closely before doing the lpr changes. Some changes along these lines will (hopefully!) go into lpr this weekend, but I can't speak for the rest of the patches you've made. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message