fix undefined behaviour due to a reference to a destroyed temporary object

This commit is contained in:
Maksim Kuzevanov 2016-07-01 11:11:29 +03:00
parent 89eda45df2
commit e3b7e6abd6
1 changed files with 2 additions and 1 deletions

View File

@ -123,7 +123,8 @@ uint64_t ConnectionImpl::parse(const Buffer &buffer)
try
{
// try to recognize the frame
ReceivedFrame receivedFrame(ReducedBuffer(buffer, processed), _maxFrame);
ReducedBuffer reduced_buf(buffer, processed);
ReceivedFrame receivedFrame(reduced_buf, _maxFrame);
// do we have the full frame?
if (receivedFrame.complete())