VUL: check bytes remaining in xrdp_rdp_process_data_input

ulab-next
Jay Sorg 11 years ago
parent f75b9143e2
commit 445e7d9800

@ -1322,12 +1322,20 @@ xrdp_rdp_process_data_input(struct xrdp_rdp *self, struct stream *s)
int param2; int param2;
int time; int time;
if (!s_check_rem(s, 4))
{
return 1;
}
in_uint16_le(s, num_events); in_uint16_le(s, num_events);
in_uint8s(s, 2); /* pad */ in_uint8s(s, 2); /* pad */
DEBUG(("in xrdp_rdp_process_data_input %d events", num_events)); DEBUG(("in xrdp_rdp_process_data_input %d events", num_events));
for (index = 0; index < num_events; index++) for (index = 0; index < num_events; index++)
{ {
if (!s_check_rem(s, 12))
{
return 1;
}
in_uint32_le(s, time); in_uint32_le(s, time);
in_uint16_le(s, msg_type); in_uint16_le(s, msg_type);
in_uint16_le(s, device_flags); in_uint16_le(s, device_flags);

Loading…
Cancel
Save