From owner-freebsd-current Sat Oct 14 16:18:29 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA22248 for current-outgoing; Sat, 14 Oct 1995 16:18:29 -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 QAA22243 for ; Sat, 14 Oct 1995 16:18:27 -0700 Received: from corbin.Root.COM (corbin [198.145.90.50]) by Root.COM (8.6.12/8.6.5) with ESMTP id QAA26791; Sat, 14 Oct 1995 16:18:26 -0700 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.12/8.6.5) with SMTP id QAA20339; Sat, 14 Oct 1995 16:18:10 -0700 Message-Id: <199510142318.QAA20339@corbin.Root.COM> To: John Capo cc: terry@lambert.org (Terry Lambert), freebsd-current@freefall.freebsd.org Subject: Re: phkmalloc and X programs In-reply-to: Your message of "Sat, 14 Oct 95 18:48:35 EDT." <199510142248.SAA14930@irbs.irbs.com> From: David Greenman Reply-To: davidg@Root.COM Date: Sat, 14 Oct 1995 16:18:10 -0700 Sender: owner-current@FreeBSD.org Precedence: bulk >lname is not NULL terminated unless malloc() returns zeroed memory. >I have never seen anything that states that malloc() returns zeroed >memory nor have I seen bzero/memset in the BSD malloc() sources. That's because it is only by accident that xhost works. BSD malloc just happens to have the chunks in a somewhat different order than phkmalloc and the chunk that happens to be returned in the case you've pointed out simply hadn't been previously allocated (so it containis all zeros). Even the manual page for (BSD) malloc says that it returns uninitialized data. Anyway, you're absolutely right - it's a bug in xhost. -DG