fix zip path traversal

this makes sure that the file is in the given root

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-02-15 10:22:37 +02:00
parent 437242169d
commit 56936cf485
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
5 changed files with 42 additions and 3 deletions

View file

@ -233,7 +233,7 @@ std::optional<QStringList> extractSubDir(ArchiveReader* zip, const QString& subd
<< target;
return false;
}
if (!f->writeFile(ext, target_file_path)) {
if (!f->writeFile(ext, target_file_path, target)) {
qWarning() << "Failed to extract file" << original_name << "to" << target_file_path;
return false;
}