Be tolerant of cropped TS_SHARECONTROLHEADER

Old versions of Windows (e.g. XP) sends a cropped packet in some
cases. It still contains all the important parts, so let's be
tolerant of this misbehaviour.
This commit is contained in:
Pierre Ossman 2019-09-19 09:18:42 +02:00
parent 75215ad90b
commit a646a5cce2

14
rdp.c
View File

@ -124,12 +124,22 @@ rdp_ts_in_share_control_header(STREAM s, uint8 * type, uint16 * length)
}
in_uint16_le(s, pdu_type); /* pduType */
in_uint16(s, pdu_source); /* pduSource */
*type = pdu_type & 0xf;
/* XP omits pduSource for PDUTYPE_DEACTIVATEALLPDU for some reason */
if (*length == 4) {
logger(Protocol, Debug,
"rdp_ts_in_share_control_header(), missing pduSource field for 0x%x PDU",
*type);
} else {
in_uint16(s, pdu_source); /* pduSource */
}
/* Give just the size of the data */
if (*length >= 6)
*length -= 6;
else
*length = 0;
return True;
}