I found it - calloc() for zero bytes is nonportable. It might return
a valid pointer to the heap, or it could return NULL. In Tru64 and AIX
it returns the latter. (I actually fixed this same bug in Parrot not
too long ago.) No, I didn't look at which code tried to allocate zero
bytes, but I think it was eight things each of zero bytes.
Please find attached two patches:
(1) util.c that fortifies Perl_safesyscalloc() against zero allocs
by always calloc()ing (or malloc()ing) at least something. I also
added "wrap-around" guards similar to PERL_MALLOC_WRAP().
(2) adds some notes to perlhack
Thread Previous
|
Thread Next