mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +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();
|
||||
parseDateTime();
|
||||
Poco::UInt16 len = getFileNameLength();
|
||||
Poco::Buffer<char> buf(len);
|
||||
inp.read(buf.begin(), len);
|
||||
_fileName = std::string(buf.begin(), len);
|
||||
if (len > 0)
|
||||
{
|
||||
Poco::Buffer<char> buf(len);
|
||||
inp.read(buf.begin(), len);
|
||||
_fileName = std::string(buf.begin(), len);
|
||||
}
|
||||
if (hasExtraField())
|
||||
{
|
||||
len = getExtraFieldLength();
|
||||
Poco::Buffer<char> xtra(len);
|
||||
inp.read(xtra.begin(), len);
|
||||
_extraField = std::string(xtra.begin(), len);
|
||||
if (len > 0)
|
||||
{
|
||||
Poco::Buffer<char> xtra(len);
|
||||
inp.read(xtra.begin(), len);
|
||||
_extraField = std::string(xtra.begin(), len);
|
||||
}
|
||||
}
|
||||
len = getFileCommentLength();
|
||||
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");
|
||||
parseDateTime();
|
||||
Poco::UInt16 len = getFileNameLength();
|
||||
Poco::Buffer<char> buf(len);
|
||||
inp.read(buf.begin(), len);
|
||||
_fileName = std::string(buf.begin(), len);
|
||||
if (len > 0)
|
||||
{
|
||||
Poco::Buffer<char> buf(len);
|
||||
inp.read(buf.begin(), len);
|
||||
_fileName = std::string(buf.begin(), len);
|
||||
}
|
||||
if (hasExtraField())
|
||||
{
|
||||
len = getExtraFieldLength();
|
||||
Poco::Buffer<char> xtra(len);
|
||||
inp.read(xtra.begin(), len);
|
||||
_extraField = std::string(xtra.begin(), len);
|
||||
if (len > 0)
|
||||
{
|
||||
Poco::Buffer<char> xtra(len);
|
||||
inp.read(xtra.begin(), len);
|
||||
_extraField = std::string(xtra.begin(), len);
|
||||
}
|
||||
}
|
||||
if (!searchCRCAndSizesAfterData())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user