Fixed extraction of empty files
authorAlexander Ebert <ebert@woltlab.com>
Mon, 27 May 2013 22:52:15 +0000 (00:52 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 27 May 2013 22:52:15 +0000 (00:52 +0200)
Fixes #1310

wcfsetup/install/files/lib/system/io/Tar.class.php

index 277b6c701ab2adacc70b2ec9ec4ec0bb4cdd6923..d59ccaeeb66653232a935a323190e7ada0fc38fe 100644 (file)
@@ -204,6 +204,11 @@ class Tar implements IArchive {
                }
                $header = $this->getFileInfo($index);
                
+               // check file size
+               if (!$header['size']) {
+                       throw new SystemException("Could not untar file '".$header['filename']."', file is empty.");
+               }
+               
                FileUtil::makePath(dirname($destination));
                if ($header['type'] === 'folder') {
                        FileUtil::makePath($destination);