mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-02 15:24:57 +01:00
fix relative path check, eliminate unused warnings
This commit is contained in:
parent
f5b2cf3dd6
commit
b09b32a3de
@ -23,7 +23,7 @@ namespace Zip {
|
||||
bool ZipCommon::isValidPath(const std::string& path)
|
||||
{
|
||||
|
||||
if (!Path(path).isRelative())
|
||||
if (!Path(path).isRelative() || !Path(path, Path::PATH_WINDOWS).isRelative())
|
||||
return false;
|
||||
if (path == "..")
|
||||
return false;
|
||||
|
@ -174,7 +174,6 @@ int ZipStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
// now push back the header to the stream, so that the ZipLocalFileHeader can read it
|
||||
Poco::Int32 size = static_cast<Poco::Int32>(nfo.getFullHeaderSize());
|
||||
_expectedCrc32 = nfo.getCRC32();
|
||||
const char* rawHeader = nfo.getRawHeader();
|
||||
_pIstr->seekg(-size, std::ios::cur);
|
||||
if (!_pIstr->good()) throw Poco::IOException("Failed to seek on input stream");
|
||||
if (!crcValid())
|
||||
|
@ -52,16 +52,16 @@ void ZipTest::testSkipSingleFile()
|
||||
ZipLocalFileHeader hdr(inp, false, skip);
|
||||
assert (ZipCommon::HS_FAT == hdr.getHostSystem());
|
||||
int major = hdr.getMajorVersionNumber();
|
||||
int minor = hdr.getMinorVersionNumber();
|
||||
int POCO_UNUSED minor = hdr.getMinorVersionNumber();
|
||||
assert (major <= 2);
|
||||
std::size_t hdrSize = hdr.getHeaderSize();
|
||||
assert (hdrSize > 30);
|
||||
ZipCommon::CompressionMethod cm = hdr.getCompressionMethod();
|
||||
ZipCommon::CompressionMethod POCO_UNUSED cm = hdr.getCompressionMethod();
|
||||
assert (!hdr.isEncrypted());
|
||||
Poco::DateTime aDate = hdr.lastModifiedAt();
|
||||
Poco::UInt64 cS = hdr.getCompressedSize();
|
||||
Poco::UInt64 uS = hdr.getUncompressedSize();
|
||||
const std::string& fileName = hdr.getFileName();
|
||||
Poco::UInt64 POCO_UNUSED cS = hdr.getCompressedSize();
|
||||
Poco::UInt64 POCO_UNUSED uS = hdr.getUncompressedSize();
|
||||
const std::string& POCO_UNUSED fileName = hdr.getFileName();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user