From owner-freebsd-audit Wed Jan 31 6: 9:39 2001 Delivered-To: freebsd-audit@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id F1E6937B491 for ; Wed, 31 Jan 2001 06:09:21 -0800 (PST) Received: from hamlet.nectar.com (hamlet.nectar.com [10.0.1.102]) by gw.nectar.com (Postfix) with ESMTP id 2195718C8F; Wed, 31 Jan 2001 08:09:21 -0600 (CST) Received: (from nectar@localhost) by hamlet.nectar.com (8.11.1/8.9.3) id f0VE9Lo05137; Wed, 31 Jan 2001 08:09:21 -0600 (CST) (envelope-from nectar@spawn.nectar.com) Date: Wed, 31 Jan 2001 08:09:21 -0600 From: "Jacques A. Vidrine" To: Mike Heffner Cc: FreeBSD-audit Subject: Re: patch for libc/net/hesiod.c Message-ID: <20010131080920.A4720@hamlet.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , Mike Heffner , FreeBSD-audit References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mheffner@vt.edu on Tue, Jan 30, 2001 at 11:01:21PM -0500 X-Url: http://www.nectar.com/ Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Jan 30, 2001 at 11:01:21PM -0500, Mike Heffner wrote: > This patch fixes some string overflow issues in the hesiod(3) > functions in libc. Thanks! You may also want to send this to , since that's where the code originates. Of course, strlcpy/strlcat may be something of a portability problem for them. > Reviews? > > > Index: hesiod.c > =================================================================== > RCS file: /home/ncvs/src/lib/libc/net/hesiod.c,v > retrieving revision 1.3 > diff -u -r1.3 hesiod.c > --- hesiod.c 2000/09/30 17:29:54 1.3 > +++ hesiod.c 2001/01/31 03:13:37 > @@ -162,7 +162,7 @@ > const char *rhs; > int len; > > - strcpy(bindname, name); > + strlcpy(bindname, name, sizeof(bindname)); How come no one checks for truncation? This should be e.g. if (strlcpy(bindname, name, sizeof(bindname)) >= sizeof(bindname)) return NULL; [snip] Cheers, -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message