From: Alexander Ebert Date: Mon, 27 May 2013 22:52:15 +0000 (+0200) Subject: Fixed extraction of empty files X-Git-Tag: 2.0.0_Beta_1~32^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bb6d6068b4c7df639602393e6d09bd43215d9273;p=GitHub%2FWoltLab%2FWCF.git Fixed extraction of empty files Fixes #1310 --- diff --git a/wcfsetup/install/files/lib/system/io/Tar.class.php b/wcfsetup/install/files/lib/system/io/Tar.class.php index 277b6c701a..d59ccaeeb6 100644 --- a/wcfsetup/install/files/lib/system/io/Tar.class.php +++ b/wcfsetup/install/files/lib/system/io/Tar.class.php @@ -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);