]> granicus.if.org Git - php/commitdiff
MFB: fix Bug #46194: SIGSEGV when requested file is not found
authorGreg Beaver <cellog@php.net>
Tue, 30 Sep 2008 02:40:37 +0000 (02:40 +0000)
committerGreg Beaver <cellog@php.net>
Tue, 30 Sep 2008 02:40:37 +0000 (02:40 +0000)
ext/phar/phar.c

index 0065367bb92af6b846b891b0b77056b8b3b0e649..7ae4af4f265ed19e6cc78ddb82423aa1d8183093 100644 (file)
@@ -3291,6 +3291,9 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
        int failed;
        phar_archive_data *phar;
 
+       if (!file_handle || !file_handle->filename) {
+               return phar_orig_compile_file(file_handle, type TSRMLS_CC);
+       }
        if (strstr(file_handle->filename, ".phar") && !strstr(file_handle->filename, "://")) {
                if (SUCCESS == phar_open_from_filename(file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
                        if (phar->is_zip || phar->is_tar) {