mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-06 00:31:10 +01:00
fixed issues reported by Klocwork
This commit is contained in:
parent
8d053e259c
commit
caed8507f4
@ -98,15 +98,21 @@ void ZipFileInfo::parse(std::istream& inp, bool assumeHeaderRead)
|
|||||||
_uncompressedSize = getUncompressedSizeFromHeader();
|
_uncompressedSize = getUncompressedSizeFromHeader();
|
||||||
parseDateTime();
|
parseDateTime();
|
||||||
Poco::UInt16 len = getFileNameLength();
|
Poco::UInt16 len = getFileNameLength();
|
||||||
Poco::Buffer<char> buf(len);
|
if (len > 0)
|
||||||
inp.read(buf.begin(), len);
|
{
|
||||||
_fileName = std::string(buf.begin(), len);
|
Poco::Buffer<char> buf(len);
|
||||||
|
inp.read(buf.begin(), len);
|
||||||
|
_fileName = std::string(buf.begin(), len);
|
||||||
|
}
|
||||||
if (hasExtraField())
|
if (hasExtraField())
|
||||||
{
|
{
|
||||||
len = getExtraFieldLength();
|
len = getExtraFieldLength();
|
||||||
Poco::Buffer<char> xtra(len);
|
if (len > 0)
|
||||||
inp.read(xtra.begin(), len);
|
{
|
||||||
_extraField = std::string(xtra.begin(), len);
|
Poco::Buffer<char> xtra(len);
|
||||||
|
inp.read(xtra.begin(), len);
|
||||||
|
_extraField = std::string(xtra.begin(), len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
len = getFileCommentLength();
|
len = getFileCommentLength();
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
|
@ -117,15 +117,21 @@ void ZipLocalFileHeader::parse(std::istream& inp, bool assumeHeaderRead)
|
|||||||
throw Poco::DataFormatException("bad ZIP file header", "invalid compression method");
|
throw Poco::DataFormatException("bad ZIP file header", "invalid compression method");
|
||||||
parseDateTime();
|
parseDateTime();
|
||||||
Poco::UInt16 len = getFileNameLength();
|
Poco::UInt16 len = getFileNameLength();
|
||||||
Poco::Buffer<char> buf(len);
|
if (len > 0)
|
||||||
inp.read(buf.begin(), len);
|
{
|
||||||
_fileName = std::string(buf.begin(), len);
|
Poco::Buffer<char> buf(len);
|
||||||
|
inp.read(buf.begin(), len);
|
||||||
|
_fileName = std::string(buf.begin(), len);
|
||||||
|
}
|
||||||
if (hasExtraField())
|
if (hasExtraField())
|
||||||
{
|
{
|
||||||
len = getExtraFieldLength();
|
len = getExtraFieldLength();
|
||||||
Poco::Buffer<char> xtra(len);
|
if (len > 0)
|
||||||
inp.read(xtra.begin(), len);
|
{
|
||||||
_extraField = std::string(xtra.begin(), len);
|
Poco::Buffer<char> xtra(len);
|
||||||
|
inp.read(xtra.begin(), len);
|
||||||
|
_extraField = std::string(xtra.begin(), len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!searchCRCAndSizesAfterData())
|
if (!searchCRCAndSizesAfterData())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user