Re: Return value of malloc(0)
- From: Matthias Andree <matthias.andree@xxxxxx>
- Date: Thu, 29 Jun 2006 18:09:37 +0200
Johannes Weiner <hnazfoo@xxxxxxxxxxxxxx> writes:
Hi,
On Wed, Jun 28, 2006 at 08:10:45PM +0200, Andre Albsmeier wrote:
"If you use malloc(0) and are crazy enough to access the 'allocated'
memory we give you a SIGSEV to show you how dumb you are :-)".
They should check the return value of malloc() in any case for
successful allocation.. shouldn't they?
The value returned from malloc(0) must not be dereferenced whatever it
was. It was 0x800, which doesn't count as "failure".
--
Matthias Andree
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Return value of malloc(0)
- From: Johannes Weiner
- Re: Return value of malloc(0)
- References:
- Return value of malloc(0)
- From: Andre Albsmeier
- Re: Return value of malloc(0)
- From: Johannes Weiner
- Return value of malloc(0)
- Prev by Date: Re: Return value of malloc(0)
- Next by Date: Re: NVIDIA FreeBSD kernel feature requests
- Previous by thread: Re: Return value of malloc(0)
- Next by thread: Re: Return value of malloc(0)
- Index(es):
Relevant Pages
|
|