com php-src: Merge branch 'PHP-7.0' into PHP-7.1: sapi/phpdbg/phpdbg.c
| From: | Anatol Belski | Date: | Thu, 27 Oct 2016 00:20:12 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.0' into PHP-7.1: sapi/phpdbg/phpdbg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95299@lists.php.net to get a copy of this message | ||
Commit: 4e3eb4a5f88846f589bf4066ed2fe14a227650bb
Author: Anatol Belski <ab@php.net> Thu, 27 Oct 2016 02:20:12 +0200
Parents: 4616441980b5c770c54bb809139810cb61824997 b9993c8b6c159c55515938dc09d25ed47ffe4649
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4e3eb4a5f88846f589bf4066ed2fe14a227650bb
Log:
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
fix uninitialized pointer
Changed paths:
MM sapi/phpdbg/phpdbg.c
Diff:
diff --cc sapi/phpdbg/phpdbg.c
index b800f06,eb58b90..513ca69
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@@ -120,63 -191,8 +120,65 @@@ static void php_phpdbg_destroy_register
destroy_zend_function(function);
} /* }}} */
+static void php_phpdbg_destroy_file_source(zval *data) /* {{{ */
+{
+ phpdbg_file_source *source = (phpdbg_file_source *) Z_PTR_P(data);
+ destroy_op_array(&source->op_array);
+ if (source->buf) {
+ efree(source->buf);
+ }
+ efree(source->filename);
+ efree(source);
+} /* }}} */
+
+static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */
+{
+ pg->prompt[0] = NULL;
+ pg->prompt[1] = NULL;
-static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */
+ pg->colors[0] = NULL;
+ pg->colors[1] = NULL;
+ pg->colors[2] = NULL;
+
+ pg->lines = phpdbg_get_terminal_height();
+ pg->exec = NULL;
+ pg->exec_len = 0;
+ pg->buffer = NULL;
+ pg->last_was_newline = 1;
+ pg->ops = NULL;
+ pg->vmret = 0;
+ pg->in_execution = 0;
+ pg->bp_count = 0;
+ pg->flags = PHPDBG_DEFAULT_FLAGS;
+ pg->oplog = NULL;
+ memset(pg->io, 0, sizeof(pg->io));
+ pg->frame.num = 0;
+ pg->sapi_name_ptr = NULL;
+ pg->socket_fd = -1;
+ pg->socket_server_fd = -1;
+ pg->unclean_eval = 0;
+
+ pg->req_id = 0;
+ pg->err_buf.active = 0;
+ pg->err_buf.type = 0;
+
+ pg->input_buflen = 0;
+ pg->sigsafe_mem.mem = NULL;
+ pg->sigsegv_bailout = NULL;
+
+ pg->oplog_list = NULL;
+
+#ifdef PHP_WIN32
+ pg->sigio_watcher_thread = INVALID_HANDLE_VALUE;
+ memset(&pg->swd, 0, sizeof(struct win32_sigio_watcher_data));
+#endif
+
+ pg->eol = PHPDBG_EOL_LF;
++
++ pg->stdin_file = NULL;
+} /* }}} */
+
+static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */
{
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], 8, NULL, php_phpdbg_destroy_bp_file, 0);
zend_hash_init(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING], 8, NULL, php_phpdbg_destroy_bp_file,
0);