diff options
author | Dr. Lars Völker <lars.voelker@technica-engineering.de> | 2021-07-22 22:29:44 +0200 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-08-25 13:40:12 +0000 |
commit | 8e2cd4f652b546a41d68f2e55767f953877a7a1b (patch) | |
tree | e2bcfa1c2429f35a9e60ca100888f0a53be09081 /ui/qt | |
parent | d884af52e98461982cebf8b969e4716b27ba03c1 (diff) |
UI: Import profiles from ZIP supporting bigger files (Bugfix)
This patch allows the profile importer to recover from a file too large
to import as well as adjusts the maximum allowed config file size.
Closes: #17504
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/models/profile_model.cpp | 3 | ||||
-rw-r--r-- | ui/qt/utils/wireshark_zip_helper.cpp | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/ui/qt/models/profile_model.cpp b/ui/qt/models/profile_model.cpp index f0b61beb8c..589cb1076a 100644 --- a/ui/qt/models/profile_model.cpp +++ b/ui/qt/models/profile_model.cpp @@ -1091,7 +1091,8 @@ bool ProfileModel::acceptFile(QString fileName, int fileSize) if (fileName.toLower().endsWith(".zip")) return false; - if (fileSize > 1024 * 512) + /* Arbitrary maximum config file size accepted: 256MB */ + if (fileSize > 1024 * 1024 * 256) return false; return true; diff --git a/ui/qt/utils/wireshark_zip_helper.cpp b/ui/qt/utils/wireshark_zip_helper.cpp index f7ab5dc5df..bcc9f43900 100644 --- a/ui/qt/utils/wireshark_zip_helper.cpp +++ b/ui/qt/utils/wireshark_zip_helper.cpp @@ -67,7 +67,17 @@ bool WiresharkZipHelper::unzip(QString zipFile, QString directory, bool (*fileCh /* Sanity check for the file */ if (fileInZip.length() == 0 || (fileCheck && ! fileCheck(fileInZip, fileSize)) ) + { + if ((cnt + 1) < nmbr) + { + err = unzGoToNextFile(uf); + if (err != UNZ_OK) + { + break; + } + } continue; + } if (di.exists()) { |