[PATCH 1/2] add calloc and callocBytes to Foreign.Marshal.Alloc

Matthias Kilian kili at outback.escape.de
Fri Apr 22 21:14:34 CEST 2011


On Fri, Apr 22, 2011 at 03:05:48PM -0400, Daniel Peebles wrote:
> calloc is just a multiplication followed by malloc followed by memset.

Bummer. You just forgot the overflow check before the multiplication. And I
don't think calloc(3) is silly.

Ciao,
	Kili



More information about the Libraries mailing list