From owner-freebsd-audit Fri Aug 4 19:48:43 2000 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.100.7]) by hub.freebsd.org (Postfix) with ESMTP id 0EA1B37B6BB; Fri, 4 Aug 2000 19:48:39 -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.9.3/8.9.3) with ESMTP id WAA169824; Fri, 4 Aug 2000 22:48:32 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <200008042133.PAA13109@harmony.village.org> References: <200008042133.PAA13109@harmony.village.org> Date: Fri, 4 Aug 2000 22:48:49 -0400 To: Warner Losh , Kris Kennaway From: Garance A Drosihn Subject: Re: strncpy bugs Cc: audit@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 3:33 PM -0600 8/4/00, Warner Losh wrote: > >Usually, I do the following stylaistically: > strncpy(dst, src, X); > dst[X] = '\0'; >where X is the size of the buffer minus 1. > >This goes to show how right Theo de Raadt was with his strlcpy >API change :-). Getting this right is too tedious to be left >to the user. So, should we change our habits, and use strlcpy fixes instead of repeatedly rewriting strncpy fixes? --- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or drosih@rpi.edu Rensselaer Polytechnic Institute To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message