Limit the number of client announced monitors

The specs says that only 16 are allowed, so let's make that limitation a
reality.
This commit is contained in:
David Fort 2017-02-21 11:02:12 +01:00
parent 09e3d29f2b
commit 837491ba24
1 changed files with 6 additions and 0 deletions

View File

@ -1705,6 +1705,12 @@ BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
Stream_Read_UINT32(s, flags); /* flags */
Stream_Read_UINT32(s, monitorCount); /* monitorCount */
if (monitorCount > 16)
{
WLog_ERR(TAG, "announced monitors(%"PRIu32") exceed the 16 limit", monitorCount);
return FALSE;
}
if (monitorCount > settings->MonitorDefArraySize)
{
WLog_ERR(TAG, "too many announced monitors(%"PRIu32"), clamping to %"PRIu32"", monitorCount,