From: Josef Möllers Date: Thu, 4 Apr 2019 09:25:00 +0000 (+0200) Subject: Added test for unzip-mem -v X-Git-Tag: v0.13.70~6^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b286ce6ac3575a2186011d21a18c8dcabe2a8bd;p=zziplib Added test for unzip-mem -v When verbously listing a compressed zipfile containing a directory using unzip-mem, a division-by-zero is performed. This bug was fixed and the test checks for this. --- diff --git a/test/zziptests.py b/test/zziptests.py index 64d3aa8..bba54a0 100644 --- a/test/zziptests.py +++ b/test/zziptests.py @@ -3429,6 +3429,26 @@ class ZZipTest(unittest.TestCase): self.assertTrue(os.path.exists(workdir+"/test/evil.conf")) self.rm_testdir() + def test_65485_list_verbose_compressed_with_directory(self): + """ verbously list a zipfile containing directories """ + tmpdir = self.testdir() + workdir = tmpdir + "/d" + zipname = "ZIPfile" + os.makedirs(workdir) + f= open(tmpdir + "/d/file","w+") + for i in range(10): + f.write("This is line %d\r\n" % (i+1)) + f.close() + # create the ZIPfile + exe=self.bins("zzip") + run = shell("chdir {tmpdir} && ../{exe} -9 {zipname}.zip d".format(**locals())) + self.assertFalse(run.returncode) + # list the ZIPfile + exe=self.bins("unzip-mem"); + run = shell("chdir {tmpdir} && ../{exe} -v {zipname}.zip".format(**locals())) + self.assertFalse(run.returncode) + self.rm_testdir() + def test_91000_zzshowme_check_sfx(self): """ create an *.exe that can extract its own zip content """ exe=self.bins("mkzip")