mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-26 00:40:05 +01:00
fixed #331: Poco::Zip does not support files with .. in the name.
This commit is contained in:
@@ -81,8 +81,8 @@ bool Decompress::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeade
|
||||
if (!_flattenDirs)
|
||||
{
|
||||
std::string dirName = hdr.getFileName();
|
||||
if (dirName.find(ZipCommon::ILLEGAL_PATH) != std::string::npos)
|
||||
throw ZipException("Illegal entry name " + dirName + " containing " + ZipCommon::ILLEGAL_PATH);
|
||||
if (!ZipCommon::isValidPath(dirName))
|
||||
throw ZipException("Illegal entry name " + dirName + " containing parent directory reference");
|
||||
Poco::Path dir(_outDir, dirName);
|
||||
dir.makeDirectory();
|
||||
Poco::File aFile(dir);
|
||||
@@ -101,8 +101,8 @@ bool Decompress::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeade
|
||||
fileName = p.getFileName();
|
||||
}
|
||||
|
||||
if (fileName.find(ZipCommon::ILLEGAL_PATH) != std::string::npos)
|
||||
throw ZipException("Illegal entry name " + fileName + " containing " + ZipCommon::ILLEGAL_PATH);
|
||||
if (!ZipCommon::isValidPath(fileName))
|
||||
throw ZipException("Illegal entry name " + fileName + " containing parent directory reference");
|
||||
|
||||
Poco::Path file(fileName);
|
||||
file.makeFile();
|
||||
|
||||
Reference in New Issue
Block a user