Ensure urb_create_iocompletion uses size_t for calculation

This commit is contained in:
akallabeth 2022-10-13 08:36:26 +02:00 committed by akallabeth
parent b54ca508ac
commit 49bd22aea7

View File

@ -97,7 +97,13 @@ static wStream* urb_create_iocompletion(UINT32 InterfaceField, UINT32 MessageId,
UINT32 OutputBufferSize)
{
const UINT32 InterfaceId = (STREAM_ID_PROXY << 30) | (InterfaceField & 0x3FFFFFFF);
wStream* out = Stream_New(NULL, OutputBufferSize + 28);
#if UINT32_MAX >= SIZE_MAX
if (OutputBufferSize > UINT32_MAX - 28ull)
return NULL;
#endif
wStream* out = Stream_New(NULL, OutputBufferSize + 28ull);
if (!out)
return NULL;