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
This commit is contained in:
Dr. Lars Völker 2021-07-22 22:29:44 +02:00 committed by Wireshark GitLab Utility
parent d884af52e9
commit 8e2cd4f652
2 changed files with 12 additions and 1 deletions

View File

@ -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;

View File

@ -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())
{