ID:               16340
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
 Bug Type:         Unknown/Other Function
 Operating System: Linux
 PHP Version:      4.1.2
 New Comment:

This has been fixed in upcomming 4.2 already.


Previous Comments:
------------------------------------------------------------------------

[2002-03-29 02:08:30] [EMAIL PROTECTED]

Let's look at ext/zip/zip.c

Find any function that accepts resource handle and you'll see:

--------------------------------------------
    zval            **zzip_dp;
    ZZIP_DIR         *archive_p = NULL;

    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zzip_dp)
== FAILURE) {
            return;
        }

    ZEND_FETCH_RESOURCE(archive_p, ZZIP_DIR *, zzip_dp, -1,
le_zip_dir_name, le_zip_dir);
----------------------------------------------
ZEND_FETCH_RESOURCE tries to fetch something from undefined pointer -
zzip_dp. That is where core is being dumped.

I've corrected the above problem this way:
--------------------------------------------
    zval             *zzip_dp;
    ZZIP_DIR         *archive_p = NULL;

    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zzip_dp)
== FAILURE) {
            return;
        }

    ZEND_FETCH_RESOURCE(archive_p, ZZIP_DIR *, &zzip_dp, -1,
le_zip_dir_name, le_zip_dir);
---------------------------------------------
Now it fetches resources from the correct place.

You can download the whole corrected file from:
http://programmer.mail2k.ru/zip.c

WBR,
Mail2K.RU programmer
Andrew A. Kononykhin

[EMAIL PROTECTED]

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=16340&edit=1

Reply via email to