[core,gcc] check for channelMaxCount violations

This commit is contained in:
akallabeth 2024-06-03 16:45:39 +02:00
parent cbd2f5e65f
commit f422ea2e56
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
1 changed files with 7 additions and 0 deletions

View File

@ -1932,6 +1932,13 @@ BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs)
if (!Stream_CheckAndLogRequiredLengthOfSize(TAG, s, channelCount, 2ull))
return FALSE;
if (mcs->channelMaxCount < parsedChannelCount)
{
WLog_ERR(TAG, "requested %" PRIu32 " channels > channelMaxCount %" PRIu16,
mcs->channelCount, mcs->channelMaxCount);
return FALSE;
}
for (UINT32 i = 0; i < parsedChannelCount; i++)
{
rdpMcsChannel* channel = &mcs->channels[i];