Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Mar 2006 08:03:41 +1100
From:      Andrew Reilly <andrew-freebsd@areilly.bpc-users.org>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        Jason Evans <jasone@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: Proposed addition of malloc_size_np()
Message-ID:  <20060326210341.GA66065@gurney.reilly.home>
In-Reply-To: <62921.1143274763@critter.freebsd.dk>
References:  <20060325081037.GC703@turion.vk2pj.dyndns.org> <62921.1143274763@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 25, 2006 at 09:19:23AM +0100, Poul-Henning Kamp wrote:
> In message <20060325081037.GC703@turion.vk2pj.dyndns.org>, Peter Jeremy writes:
> >That restricts its use to malloc() wrappers.  I can also see the
> >benefit in a function trying to validate the size of an arbitrary
> >piece of memory that has been passed to it.
> 
> No you can't, because you cannot be certain that the pointer passed
> to you is actually an unadultered malloc pointer.

Or even that it was 'alloc'd at all.  Could be a pointer (in)to a
static or global...

-- 
Andrew



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