Re: malloc(0) returns an invalid address

From: JINMEI Tatuya / 職6柑巳6柑達哉 <jinmei_at_isl.rdc.toshiba.co.jp>
Date: Thu, 02 Dec 2004 19:55:15 +0900
>>>>> On Thu, 02 Dec 2004 11:44:20 +0100, 
>>>>> Andre Oppermann <andre_at_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_at_isl.rdc.toshiba.co.jp
Received on Thu Dec 02 2004 - 09:55:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:23 UTC