com php-src: Fix crash on Linux due to double fclose(): sapi/phpdbg/phpdbg.c
| From: | Bob Weinand | Date: | Mon, 03 Oct 2016 10:55:06 +0000 |
| Subject: | com php-src: Fix crash on Linux due to double fclose(): sapi/phpdbg/phpdbg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94821@lists.php.net to get a copy of this message | ||
Commit: 8908df690f7bc29b606421c18eb06414154fa183
Author: Bob Weinand <bobwei9@hotmail.com> Mon, 3 Oct 2016 12:55:06 +0200
Parents: 417a8ef6b45ed8510faf5ebfb7b4f8c76cb97934
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8908df690f7bc29b606421c18eb06414154fa183
Log:
Fix crash on Linux due to double fclose()
Changed paths:
M sapi/phpdbg/phpdbg.c
Diff:
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 618a72f..8b1dde5 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1296,7 +1296,7 @@ php_stream *phpdbg_stream_url_wrap_php(php_stream_wrapper *wrapper, const char
*
}
if (!strncasecmp(path, "stdin", 6) && PHPDBG_G(stdin_file)) {
- php_stream *stream =stream = php_stream_fopen_from_file(PHPDBG_G(stdin_file), "r");
+ php_stream *stream = php_stream_fopen_from_fd(dup(fileno(PHPDBG_G(stdin_file))), "r",
NULL);
#ifdef PHP_WIN32
zval *blocking_pipes = php_stream_context_get_option(context, "pipe",
"blocking");
if (blocking_pipes) {