PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » Archive_Tar » Bug #3907

Undefined variable error (v. low priority)

Details

Submitted2005-03-22 07:56 UTC
Frommakler at php dot net
Assignedvblavet
StatusClosed
PackageArchive_Tar
PHP Version4.3.10
OSany
Roadmaps(Not assigned)

Comments

[2005-03-22 07:56 UTC] makler at php dot net

Description:
------------
In _extractList function if there is an error reading a file (e.g. gzread returns less data than expected), the error message is set. In line 967 there is concatenated $v_filename, and that variable is not defined in this context. Should be changed to $v_header['filename'] (as in the patch enclosed below).

Reproduce code:
---------------
--- Tar.php.orig Tue Mar 22 08:51:04 2005
+++ Tar.php Tue Mar 22 08:52:02 2005
@@ -964,7 +964,7 @@ class Archive_Tar extends PEAR
// ----- Check the file size
clearstatcache();
if (filesize($v_header['filename']) != $v_header['size']) {
- $this->_error('Extracted file '.$v_header['filename'].' does not have the correct file size \''.filesize($v_filename).'\' ('.$v_header['size'].' expected). Archive may be corrupted.');
+ $this->_error('Extracted file '.$v_header['filename'].' does not have the correct file size \''.filesize($v_header['filename']).'\' ('.$v_header['size'].' expected). Archive may be corrupted.');
return false;
}
}

[2005-11-19 14:41 UTC] vblavet at php dot net

Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/Archive_Tar

fixed in 1.3.1