]> granicus.if.org Git - php/commitdiff
MFB: fix 017.phpt in streams.c, and very dangerous intercepting of file functions...
authorGreg Beaver <cellog@php.net>
Fri, 26 Sep 2008 23:35:11 +0000 (23:35 +0000)
committerGreg Beaver <cellog@php.net>
Fri, 26 Sep 2008 23:35:11 +0000 (23:35 +0000)
ext/phar/phar.c
ext/phar/stream.c

index 4c351751f93e5429a88f54c742f8011c0f5feb12..0065367bb92af6b846b891b0b77056b8b3b0e649 100644 (file)
@@ -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);
        }
 }
 /* }}} */
index 3a50962398a56af207c80c6ade39f8e5f40702e0..665fae97d8cdc85b15275bae039d92805d81ab83 100644 (file)
@@ -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;
 }
 /* }}} */