From f06e8a1ef48f6768cb85512e966205f371ebe6aa Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Mon, 23 Dec 2019 00:18:47 +0300 Subject: [PATCH] Fix unzipping of kindlegen archive on Windows unzipping was broken due to fixes for CVE-2018-1000544 in rubyzip: [1], [2]. Also, see [3]. Fixes #32. [1]: https://github.com/rubyzip/rubyzip/pull/371 [2]: https://github.com/rubyzip/rubyzip/pull/376 [3]: https://github.com/rubyzip/rubyzip/issues/354 --- ext/Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/Rakefile b/ext/Rakefile index b585480..fa77af2 100644 --- a/ext/Rakefile +++ b/ext/Rakefile @@ -49,7 +49,7 @@ def unzip(tarball) Zip::File.open(tarball).each do |entry| dir = File.dirname(entry.name) FileUtils.mkpath(dir) if dir != '.' && !File.exist?(dir) - entry.extract unless File.exist?(entry.name) + entry.extract(dest_path=entry.name) unless File.exist?(entry.name) end end