From: Greg Beaver Date: Fri, 26 Sep 2008 23:35:11 +0000 (+0000) Subject: MFB: fix 017.phpt in streams.c, and very dangerous intercepting of file functions... X-Git-Tag: BEFORE_HEAD_NS_CHANGE~327 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae98beaf02cf748ac30e047d8c8a1569db3aa670;p=php MFB: fix 017.phpt in streams.c, and very dangerous intercepting of file functions in all cases introduced in multi-threaded fix --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 4c351751f9..0065367bb9 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3561,7 +3561,6 @@ void phar_request_initialize(TSRMLS_D) /* {{{ */ PHAR_G(cwd) = NULL; PHAR_G(cwd_len) = 0; PHAR_G(cwd_init) = 0; - phar_intercept_functions(TSRMLS_C); } } /* }}} */ diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 3a50962398..665fae97d8 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -258,7 +258,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, char *pat entry = (phar_entry_info *) ecalloc(1, sizeof(phar_entry_info)); entry->is_temp_dir = 1; - entry->filename = ""; + entry->filename = estrndup("", 0); entry->filename_len = 0; entry->phar = phar; entry->offset = entry->offset_abs = 0; @@ -346,15 +346,8 @@ phar_stub: */ static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ { - phar_entry_info *entry = ((phar_entry_data *)stream->abstract)->internal_file; - int is_temp_dir = entry->is_temp_dir; - phar_entry_delref((phar_entry_data *)stream->abstract TSRMLS_CC); - if (is_temp_dir) { - /* phar archive stub, free it */ - efree(entry); - } return 0; } /* }}} */