From owner-freebsd-current Sat Oct 14 19:44:02 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id TAA26831 for current-outgoing; Sat, 14 Oct 1995 19:44:02 -0700 Received: from Root.COM (implode.Root.COM [198.145.90.17]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id TAA26826 for ; Sat, 14 Oct 1995 19:43:57 -0700 Received: from corbin.Root.COM (corbin [198.145.90.50]) by Root.COM (8.6.12/8.6.5) with ESMTP id TAA19530; Sat, 14 Oct 1995 19:43:56 -0700 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.12/8.6.5) with SMTP id TAA04565; Sat, 14 Oct 1995 19:43:12 -0700 Message-Id: <199510150243.TAA04565@corbin.Root.COM> To: Terry Lambert cc: bde@zeta.org.au (Bruce Evans), jc@irbs.com, freebsd-current@freefall.freebsd.org Subject: Re: phkmalloc and X programs In-reply-to: Your message of "Sat, 14 Oct 95 19:19:54 PDT." <199510150219.TAA22252@phaeton.artisoft.com> From: David Greenman Reply-To: davidg@Root.COM Date: Sat, 14 Oct 1995 19:43:12 -0700 Sender: owner-current@FreeBSD.org Precedence: bulk >Probably the "correct" "fix" is to change: > if (!strncmp("inet:", lname, 5)) { >To: > if (namelen >= 5 && !strncmp("inet:", lname, 5)) { No, lname is also used later in the code. The correct fix is to malloc namelen+1 and null terminate the string after copy/converting it to lowercase. e.g. lname[namelen] = '\0'; -DG