fix(Net): A SEGV at Net/src/MultipartReader.cpp:164:1 #4915

This commit is contained in:
Günter Obiltschnig
2025-04-15 22:11:47 +02:00
parent eaf6e28327
commit a0822e02ca
2 changed files with 5 additions and 8 deletions

View File

@@ -175,23 +175,20 @@ MultipartInputStream::~MultipartInputStream()
MultipartReader::MultipartReader(std::istream& istr):
_istr(istr),
_pMPI(0)
_istr(istr)
{
}
MultipartReader::MultipartReader(std::istream& istr, const std::string& boundary):
_istr(istr),
_boundary(boundary),
_pMPI(0)
_boundary(boundary)
{
}
MultipartReader::~MultipartReader()
{
delete _pMPI;
}
@@ -209,8 +206,7 @@ void MultipartReader::nextPart(MessageHeader& messageHeader)
throw MultipartException("No more parts available");
}
parseHeader(messageHeader);
delete _pMPI;
_pMPI = new MultipartInputStream(_istr, _boundary);
_pMPI = std::make_unique<MultipartInputStream>(_istr, _boundary);
}