[winpr,stream] Check Stream_SetLength return

This commit is contained in:
Armin Novak
2026-03-02 10:54:55 +01:00
parent b8c32fbdd5
commit 5a532269ef
20 changed files with 106 additions and 59 deletions

View File

@@ -1743,7 +1743,11 @@ static void* stream_copy(const void* obj)
if (!dst)
return nullptr;
memcpy(Stream_Buffer(dst), Stream_ConstBuffer(src), Stream_Capacity(dst));
Stream_SetLength(dst, Stream_Length(src));
if (!Stream_SetLength(dst, Stream_Length(src)))
{
Stream_Free(dst, TRUE);
return nullptr;
}
Stream_SetPosition(dst, Stream_GetPosition(src));
return dst;
}