From: Anatol Belski Date: Thu, 27 Oct 2016 00:20:12 +0000 (+0200) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.1.0RC6~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e3eb4a5f88846f589bf4066ed2fe14a227650bb;p=php Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: fix uninitialized pointer --- 4e3eb4a5f88846f589bf4066ed2fe14a227650bb diff --cc sapi/phpdbg/phpdbg.c index b800f061d2,eb58b90a47..513ca69a04 --- 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);