From d49f744526226ae15c71014c2990d79a6244a29c Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 5 Apr 2022 16:38:10 +0200 Subject: [PATCH] Unify stream positioning on fastpath updates --- libfreerdp/core/fastpath.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libfreerdp/core/fastpath.c b/libfreerdp/core/fastpath.c index da5ea30e9..7e10844e4 100644 --- a/libfreerdp/core/fastpath.c +++ b/libfreerdp/core/fastpath.c @@ -342,6 +342,9 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, wStream* if (!fastpath || !fastpath->rdp || !s) return -1; + Stream_SealLength(s); + Stream_SetPosition(s, 0); + update = fastpath->rdp->update; if (!update || !update->pointer || !update->context) @@ -463,6 +466,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, wStream* break; } + Stream_SetPosition(s, 0); if (!rc) { WLog_ERR(TAG, "Fastpath update %s [%" PRIx8 "] failed, status %d", @@ -548,10 +552,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s) goto out_fail; } - Stream_SealLength(fastpath->updateData); - Stream_SetPosition(fastpath->updateData, 0); status = fastpath_recv_update(fastpath, updateCode, fastpath->updateData); - Stream_SetPosition(fastpath->updateData, 0); if (status < 0) { @@ -606,10 +607,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s) } fastpath->fragmentation = -1; - Stream_SealLength(fastpath->updateData); - Stream_SetPosition(fastpath->updateData, 0); status = fastpath_recv_update(fastpath, updateCode, fastpath->updateData); - Stream_SetPosition(fastpath->updateData, 0); if (status < 0) {