]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0' into PHP-7.1
authorAnatol Belski <ab@php.net>
Thu, 27 Oct 2016 00:20:12 +0000 (02:20 +0200)
committerAnatol Belski <ab@php.net>
Thu, 27 Oct 2016 00:20:12 +0000 (02:20 +0200)
* PHP-7.0:
  fix uninitialized pointer

1  2 
sapi/phpdbg/phpdbg.c

index b800f061d2c80096e4bd358f6fd0db6e034e5ff7,eb58b90a47da5c90b886fcff5839141239e20914..513ca69a04ae20f9487c61a8f9e380c328a52c42
@@@ -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);