Re: [PATCH 1/2] xlib: Don't crash when swapping a 0-sized glyph

James Cloos <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
AJ> malloc(0) needn't return NULL, and on glibc, doesn't.

BE> BTW, is this a recent change?  I noticed a bug because of it in harfbuzz also.

AJ> I don't believe so.  RHEL5's glibc has this property, so it's probably
AJ> been this way since at least 2006.

A quick look at the history for the malloc.c file in glibc shows
the comment fragment:

    Even a request for zero bytes (i.e., malloc(0)) returns a
    pointer to something of the minimum allocatable size.

was included in the first version of malloc/malloc.c committed to glibc
back on 1996/Dec/08.

Glibc may never have returned NULL from malloc(0).

I do not recall what libc5 did, nor what the BSDs or the commercial
unixen did back then.

-JimC
-- 
James Cloos <[email protected]>         OpenPGP: 1024D/ED7DAEA6
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.