From c3f1c325e5ee2323a5e4bd24d4d00902714dd75b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Tue, 10 Jan 2012 23:04:10 -0500 Subject: [PATCH] libfreerdp-core: fix encoding of capability set headers --- libfreerdp-core/capabilities.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libfreerdp-core/capabilities.c b/libfreerdp-core/capabilities.c index 5c07596bc..8ec9c33a1 100644 --- a/libfreerdp-core/capabilities.c +++ b/libfreerdp-core/capabilities.c @@ -79,7 +79,7 @@ uint8* rdp_capability_set_start(STREAM* s) uint8* header; stream_get_mark(s, header); - stream_seek(s, CAPSET_HEADER_LENGTH); + stream_write_zero(s, CAPSET_HEADER_LENGTH); return header; } @@ -87,11 +87,14 @@ uint8* rdp_capability_set_start(STREAM* s) void rdp_capability_set_finish(STREAM* s, uint8* header, uint16 type) { uint16 length; + uint8* footer; - length = s->p - header; + footer = s->p; + length = footer - header; stream_set_mark(s, header); + rdp_write_capability_set_header(s, length, type); - stream_set_mark(s, header + length); + stream_set_mark(s, footer); } /**