From 699ca560fed0e13b9c0639b01e372f19816ccc8c Mon Sep 17 00:00:00 2001 From: Jacob Date: Wed, 23 Dec 2020 19:53:42 +0100 Subject: [PATCH] Switch zip handling to use github.com/klauspost/compress/zip (#273) * Switch zip handling to use github.com/klauspost/compress/zip This improves the performence over teh stdlib implementation. * Add in a couple missed changes --- cmd/arc/main.go | 2 +- testdata/create-evil-zip.go | 3 ++- zip.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/arc/main.go b/cmd/arc/main.go index 1050cd05..fd28ac5f 100644 --- a/cmd/arc/main.go +++ b/cmd/arc/main.go @@ -2,7 +2,6 @@ package main import ( "archive/tar" - "archive/zip" "bytes" "compress/flate" "flag" @@ -11,6 +10,7 @@ import ( "path/filepath" "strings" + "github.com/klauspost/compress/zip" "github.com/mholt/archiver/v3" "github.com/nwaples/rardecode" ) diff --git a/testdata/create-evil-zip.go b/testdata/create-evil-zip.go index 972fdb11..197b6475 100644 --- a/testdata/create-evil-zip.go +++ b/testdata/create-evil-zip.go @@ -1,10 +1,11 @@ package main import ( - "archive/zip" "log" "os" "time" + + "github.com/klauspost/compress/zip" ) func main() { diff --git a/zip.go b/zip.go index 81694bdc..8a552017 100644 --- a/zip.go +++ b/zip.go @@ -1,7 +1,6 @@ package archiver import ( - "archive/zip" "bytes" "compress/flate" "fmt" @@ -14,6 +13,7 @@ import ( "strings" "github.com/dsnet/compress/bzip2" + "github.com/klauspost/compress/zip" "github.com/klauspost/compress/zstd" "github.com/ulikunitz/xz" )