Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Dec 2004 19:55:15 +0900
From:      JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= <jinmei@isl.rdc.toshiba.co.jp>
To:        Andre Oppermann <andre@freebsd.org>
Cc:        current@FreeBSD.org
Subject:   Re: malloc(0) returns an invalid address
Message-ID:  <y7vllchnf58.wl@ocean.jinmei.org>
In-Reply-To: <41AEF204.2070402@freebsd.org>
References:  <y7vfz2qpltw.wl@ocean.jinmei.org> <MDEHLPKNGKAHNMBLJOLKMEAKADAB.davids@webmaster.com> <y7v1xe9p87u.wl@ocean.jinmei.org> <41AEF204.2070402@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> On Thu, 02 Dec 2004 11:44:20 +0100, 
>>>>> Andre Oppermann <andre@freebsd.org> said:

>> I expected the answer:-)  This is probably a matter of the definition
>> of "validness", and I won't argue about this point.  (and, of course,
>> it cannot be justified to dereference a zero-length pointer, whether
>> the result is segfault or not)
>> 
>> BTW: the "same problem" (of segfault) does actually NOT occur with
>> malloc(1) and int * on FreeBSD 5.3 (i386).  I suspect malloc(3) takes
>> a special action with the size of zero.

> man malloc(3) and look for options 'V' and 'X'.

I've already done this, and, sorry, this is irrelevant to this problem.

					JINMEI, Tatuya
					Communication Platform Lab.
					Corporate R&D Center, Toshiba Corp.
					jinmei@isl.rdc.toshiba.co.jp



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