libfreerdp-core: fix encoding of capability set headers

This commit is contained in:
Marc-André Moreau 2012-01-10 23:04:10 -05:00
parent 79ae6d7a0b
commit c3f1c325e5

View File

@ -79,7 +79,7 @@ uint8* rdp_capability_set_start(STREAM* s)
uint8* header; uint8* header;
stream_get_mark(s, header); stream_get_mark(s, header);
stream_seek(s, CAPSET_HEADER_LENGTH); stream_write_zero(s, CAPSET_HEADER_LENGTH);
return header; return header;
} }
@ -87,11 +87,14 @@ uint8* rdp_capability_set_start(STREAM* s)
void rdp_capability_set_finish(STREAM* s, uint8* header, uint16 type) void rdp_capability_set_finish(STREAM* s, uint8* header, uint16 type)
{ {
uint16 length; uint16 length;
uint8* footer;
length = s->p - header; footer = s->p;
length = footer - header;
stream_set_mark(s, header); stream_set_mark(s, header);
rdp_write_capability_set_header(s, length, type); rdp_write_capability_set_header(s, length, type);
stream_set_mark(s, header + length); stream_set_mark(s, footer);
} }
/** /**