mirror of
https://github.com/php/php-src.git
synced 2026-03-27 17:52:16 +01:00
Merge branch 'PHP-7.1'
* PHP-7.1: Fix intermittent segfault in GD library
This commit is contained in:
@@ -160,7 +160,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
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;
|
||||
@@ -173,7 +173,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user