summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2017-01-22 06:41:07 +0000
committerJoe Watkins <krakjoe@php.net>2017-01-22 06:41:07 +0000
commit55393e26a57c997c5f6e7a5dc68da00065a12614 (patch)
tree5ecda2c81cf121263a42e40f32043b01f75f9530 /ext/gd
parent722375c603e8c74934daf752047424e4f2fd022f (diff)
parente56fe7e5e7a926bfdf142a7a844544c0127e92b7 (diff)
downloadphp-git-55393e26a57c997c5f6e7a5dc68da00065a12614.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fix intermittent segfault in GD library
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/gd_ctx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index dd62c63664..388d66106e 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -152,7 +152,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;
@@ -165,7 +165,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) {