Bug #16340 Updated: ZZIP extension mem fault

From: Date: Fri, 29 Mar 2002 12:42:27 +0000
Subject: Bug #16340 Updated: ZZIP extension mem fault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-3603@lists.php.net to get a copy of this message
ID: 16340 Updated by: sniper@php.net Reported By: programmer@mail2k.ru Status: Closed -Bug Type: Unknown/Other Function +Bug Type: ZZiplib Related Operating System: Linux PHP Version: 4.1.2 New Comment: reclassified Previous Comments: ------------------------------------------------------------------------ [2002-03-29 02:53:50] mfischer@php.net This has been fixed in upcomming 4.2 already. ------------------------------------------------------------------------ [2002-03-29 02:08:30] programmer@mail2k.ru 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 programmer@mail2k.ru ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16340&edit=1

« previous php.bugs (#3603) next »