Added command length guard to desktop multiplexor.

This commit is contained in:
Ylian Saint-Hilaire 2021-07-30 11:18:38 -07:00
parent 4def04a58f
commit 6d7289f74a
1 changed files with 2 additions and 0 deletions

View File

@ -471,6 +471,8 @@ function CreateDesktopMultiplexor(parent, domain, nodeid, func) {
if ((typeof data != 'object') || (data.length < 4)) return; // Ignore all control traffic for now (WebRTC)
var command = data.readUInt16BE(0);
var cmdsize = data.readUInt16BE(2);
if (data.length != cmdsize) return; // Invalid command length
//console.log('ViewerData', data.length, command, cmdsize);
switch (command) {
case 1: // Key Events, forward to agent