]> granicus.if.org Git - php/commitdiff
php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the...
authorThies C. Arntzen <thies@php.net>
Thu, 2 Dec 1999 14:37:16 +0000 (14:37 +0000)
committerThies C. Arntzen <thies@php.net>
Thu, 2 Dec 1999 14:37:16 +0000 (14:37 +0000)
fixed "Uninitialized memory read" when including URLs

Zend/zend-scanner.l

index 0e5ad67eccfa85ad398438169645e57877c02617..9c1d291d1bae6a4d1315d19ef36b898334d751d1 100644 (file)
@@ -186,6 +186,10 @@ BEGIN_EXTERN_C()
 ZEND_API void zend_open_file_dtor(zend_file_handle *fh)
 {
        switch (fh->type) {
+               case ZEND_HANDLE_FILENAME:
+                       fclose(fh->handle.fp);
+                       break;
+
                case ZEND_HANDLE_FP:
                        fclose(fh->handle.fp);
                        break;
@@ -384,6 +388,7 @@ zend_op_array *compile_filename(zval *filename, zend_bool unique CLS_DC)
        }
        file_handle.filename = filename->value.str.val;
        file_handle.type = ZEND_HANDLE_FILENAME;
+       file_handle.opened_path = NULL;
        retval = zend_compile_files(1 CLS_CC, 1, &file_handle);
        if (file_handle.opened_path) {
                free(file_handle.opened_path);