Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 15 Jan 2013 23:18:43 +0100
From: Igmar Palsenberg <igmar@...senberg.com>
To: musl@...ts.openwall.com
Subject: Re: malloc(0) behaviour



>> > On 14/01/2013, Rich Felker <dalias@...ifal.cx> wrote:
>> > Another: Null means allocation failure. As malloc ought to never fail
>> > to find zero bytes free, it thus makes sense to return a non-null
>> > pointer.
>> A valid pointer also means you should be able to store something.
> 
> Says who? Fire up the mmap() man page and look at PROT_NONE.

malloc() doesn't handle that case. I also find it irrelevant in this case. You can only pass it to free() legally,
everything else is UB.




	Igmar

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.