Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Oct 1995 16:18:10 -0700
From:      David Greenman <davidg@Root.COM>
To:        John Capo <jc@irbs.com>
Cc:        terry@lambert.org (Terry Lambert), freebsd-current@freefall.freebsd.org
Subject:   Re: phkmalloc and X programs 
Message-ID:  <199510142318.QAA20339@corbin.Root.COM>
In-Reply-To: Your message of "Sat, 14 Oct 95 18:48:35 EDT." <199510142248.SAA14930@irbs.irbs.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510142318.QAA20339>