diff options
-rw-r--r-- | _test/tests/inc/tar.test.php | 18 | ||||
-rw-r--r-- | _test/tests/inc/tar/tarbomb.tgz | bin | 0 -> 183 bytes |
2 files changed, 18 insertions, 0 deletions
diff --git a/_test/tests/inc/tar.test.php b/_test/tests/inc/tar.test.php index 47851fd4c..e8805a75d 100644 --- a/_test/tests/inc/tar.test.php +++ b/_test/tests/inc/tar.test.php @@ -298,4 +298,22 @@ class Tar_TestCase extends DokuWikiTest { @unlink($tmp); } + /** + * Extract a tarbomomb + */ + public function test_tarbomb() { + $dir = dirname(__FILE__).'/tar'; + $out = sys_get_temp_dir().'/dwtartest'.md5(time()); + + $tar = new Tar(); + + $tar->open("$dir/tarbomb.tgz"); + $tar->extract($out); + + clearstatcache(); + + $this->assertFileExists($out.'/AAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB.txt'); + + TestUtils::rdelete($out); + } }
\ No newline at end of file diff --git a/_test/tests/inc/tar/tarbomb.tgz b/_test/tests/inc/tar/tarbomb.tgz Binary files differnew file mode 100644 index 000000000..8418d4073 --- /dev/null +++ b/_test/tests/inc/tar/tarbomb.tgz |