Hi,
in lib/libxmi/xmi/gc.c:42 I'd suggest a
new_gc->numInBlendStageList = nblendstages;
+ if (nblendstages > 0) {
new_gc->blendstages = (miBlendStage *)malloc(nblendstages *
sizeof(miBlendStage));
for (i = 0; i < nblendstages; i++)
new_gc->blendstages[i] = blendstages[i];
+ } else {
+ new_gc->blendstages = (miBlendStage *)0;
+ }
for preventing the allocation of 0 bytes. How is malloc(0) expected
to behave ? -- my 'malloc man page' does not tell anything about this,
but at least efence reports:
Electric Fence 2.0.5 Copyright (C) 1987-1998 Bruce Perens.
ElectricFence Aborting: Allocating 0 bytes, probably a bug.
Illegal instruction (core dumped)
--
Johannes