libzipplugin insane amount of memory for extracting
Especially for extracting.
Steps to reproduce:
- Download https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.zip
- Start Ark and disable all plugins but libzipplugin.
- Run your favorite cpu/memory usage monitor: htop, ksysguard, anything.
- Open qt-everywhere-src-5.15.0.zip in Ark.
- Extract and enjoy your system running OOM.
For 79mb qtbase-everywhere-src-5.15.0.zip archive it uses 500+ mb!
For qt-everywhere-src-5.15.0.zip it should be like 8-10gb+, haven't tested myself.
Also libzipplugin probably the slowest compared to any others.
A quickfix for extracting:
diff --git a/plugins/libzipplugin/libzipplugin.cpp b/plugins/libzipplugin/libzipplugin.cpp
index 0a8d153e..7c25addf 100644
--- a/plugins/libzipplugin/libzipplugin.cpp
+++ b/plugins/libzipplugin/libzipplugin.cpp
@@ -754,7 +754,7 @@ bool LibzipPlugin::extractEntry(zip_t *archive, const QString &entry, const QStr
default: // TODO: non-UNIX.
break;
}
-
+ zip_fclose(zipFile);
file.close();
}
Haven't tested compression or any others functions.