]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorChristoph M. Becker <cmb@php.net>
Sat, 11 Jul 2015 19:01:01 +0000 (21:01 +0200)
committerChristoph M. Becker <cmb@php.net>
Sat, 11 Jul 2015 19:01:01 +0000 (21:01 +0200)
* PHP-5.6:
  updated NEWS
  Fix #66339: PHP segfaults in imagexbm

1  2 
ext/gd/gd_ctx.c

diff --cc ext/gd/gd_ctx.c
index c848e438c727e106bca58a38c3ba77f56d4cfcc7,46331d8a8fb23011bbffbc432ab6e4d2612360e1..5f7c5ae9245ed920e7613d2df0cca5b235dd78b5
@@@ -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;