Merge pull request #10239 from akallabeth/mcs_checks

[core,gcc] check for channelMaxCount violations
This commit is contained in:
akallabeth 2024-06-03 17:40:13 +02:00 committed by GitHub
commit 34cda101c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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];