From bb6d6068b4c7df639602393e6d09bd43215d9273 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 28 May 2013 00:52:15 +0200 Subject: [PATCH] Fixed extraction of empty files Fixes #1310 --- wcfsetup/install/files/lib/system/io/Tar.class.php | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.20.1