--- sourceforge.net/trunk/rdesktop/rdp.c 2004/07/05 19:09:07 733 +++ sourceforge.net/trunk/rdesktop/rdp.c 2004/10/04 03:21:58 779 @@ -58,7 +58,13 @@ rdp_s = sec_recv(&rdpver); if (rdp_s == NULL) return NULL; - if (rdpver != 3) + if (rdpver == 0xff) + { + g_next_packet = rdp_s->end; + *type = 0; + return rdp_s; + } + else if (rdpver != 3) { /* rdp5_process should move g_next_packet ok */ rdp5_process(rdp_s); @@ -410,8 +416,7 @@ out_uint32_le(s, flags); /* list */ - out_uint8a(s, idlist + offset * sizeof(BITMAP_ID), - count * sizeof(BITMAP_ID)); + out_uint8a(s, idlist + offset * sizeof(BITMAP_ID), count * sizeof(BITMAP_ID)); s_mark_end(s); rdp_send_data(s, 0x2b); @@ -561,7 +566,7 @@ { out_uint32_le(s, BMPCACHE2_C2_CELLS); } - out_uint8s(s, 20); /* other bitmap caches not used */ + out_uint8s(s, 20); /* other bitmap caches not used */ } /* Output control capability set */ @@ -652,7 +657,7 @@ /* Output unknown capability sets */ static void -rdp_out_unknown_caps(STREAM s, uint16 id, uint16 length, uint8 *caps) +rdp_out_unknown_caps(STREAM s, uint16 id, uint16 length, uint8 * caps) { out_uint16_le(s, id); out_uint16_le(s, length); @@ -672,7 +677,7 @@ RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE + RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL + RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE + - 0x58 + 0x08 + 0x08 + 0x34 /* unknown caps */ + + 0x58 + 0x08 + 0x08 + 0x34 /* unknown caps */ + 4 /* w2k fix, why? */ ; s = sec_init(sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE)); @@ -700,11 +705,11 @@ rdp_out_pointer_caps(s); rdp_out_share_caps(s); - rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d); /* international? */ + rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d); /* international? */ rdp_out_unknown_caps(s, 0x0c, 0x08, caps_0x0c); rdp_out_unknown_caps(s, 0x0e, 0x08, caps_0x0e); - rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10); /* glyph cache? */ - + rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10); /* glyph cache? */ + s_mark_end(s); sec_send(s, sec_flags); } @@ -748,7 +753,7 @@ if (g_width != width || g_height != height) { warning("screen size changed from %dx%d to %dx%d\n", g_width, g_height, - width, height); + width, height); g_width = width; g_height = height; ui_resize_window(); @@ -1086,7 +1091,8 @@ if (ctype & RDP_MPPC_COMPRESSED) { - + if (len > RDP_MPPC_DICT_SIZE) + error("error decompressed packet size exceeds max\n"); if (mppc_expand(s->p, clen, ctype, &roff, &rlen) == -1) error("error while decompressing packet\n");