From: Christoph M. Becker Date: Sat, 11 Jul 2015 19:01:01 +0000 (+0200) Subject: Merge branch 'PHP-5.6' X-Git-Tag: php-7.1.1RC1~35^2~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77cd79012e464d7b560e361ab0305dc88133d9e1;p=php Merge branch 'PHP-5.6' * PHP-5.6: updated NEWS Fix #66339: PHP segfaults in imagexbm --- 77cd79012e464d7b560e361ab0305dc88133d9e1 diff --cc ext/gd/gd_ctx.c index c848e438c7,46331d8a8f..5f7c5ae924 --- a/ext/gd/gd_ctx.c +++ b/ext/gd/gd_ctx.c @@@ -131,9 -134,14 +131,14 @@@ static void _php_image_output_ctx(INTER RETURN_FALSE; } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, it must a filename or a stream"); + php_error_docref(NULL, E_WARNING, "Invalid 2nd parameter, it must a filename or a stream"); RETURN_FALSE; } + } else if (argc > 1 && file != NULL) { + stream = php_stream_open_wrapper(file, "wb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL); + if (stream == NULL) { + RETURN_FALSE; + } } else { ctx = emalloc(sizeof(gdIOCtx)); ctx->putC = _php_image_output_putc;