The gdIOCtx struct should be zero filled with ecalloc.
emalloc does not zero fill the struct.
RETURN_FALSE;
}
} else {
- ctx = emalloc(sizeof(gdIOCtx));
+ ctx = ecalloc(1, sizeof(gdIOCtx));
ctx->putC = _php_image_output_putc;
ctx->putBuf = _php_image_output_putbuf;
ctx->gd_free = _php_image_output_ctxfree;
}
if (!ctx) {
- ctx = emalloc(sizeof(gdIOCtx));
+ ctx = ecalloc(1, sizeof(gdIOCtx));
ctx->putC = _php_image_stream_putc;
ctx->putBuf = _php_image_stream_putbuf;
if (close_stream) {