46 lines
1.6 KiB
Diff
46 lines
1.6 KiB
Diff
From 6462eca724a886e8c1abb5b41955108023d1c1e6 Mon Sep 17 00:00:00 2001
|
|
From: Armin Novak <armin.novak@thincast.com>
|
|
Date: Wed, 9 Mar 2022 09:01:11 +0100
|
|
Subject: [PATCH] Workaround for [MS-RDPBCGR] 2.2.9.2.3 Frame Marker Command
|
|
(TS_FRAME_MARKER)
|
|
|
|
Connections with windows 2016 and 2019 sometimes receive short
|
|
frame marker. Ignore these to prevent disconnects
|
|
|
|
(cherry picked from commit 91ef44ed35c99c409d39f6c480592f8601b45e35)
|
|
---
|
|
libfreerdp/core/surface.c | 11 +++++++++--
|
|
1 file changed, 9 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/libfreerdp/core/surface.c b/libfreerdp/core/surface.c
|
|
index a99da01f3..e288799f1 100644
|
|
--- a/libfreerdp/core/surface.c
|
|
+++ b/libfreerdp/core/surface.c
|
|
@@ -181,14 +181,21 @@ static BOOL update_recv_surfcmd_frame_marker(rdpUpdate* update, wStream* s)
|
|
{
|
|
SURFACE_FRAME_MARKER marker;
|
|
|
|
- if (Stream_GetRemainingLength(s) < 6)
|
|
+ if (Stream_GetRemainingLength(s) < 2)
|
|
{
|
|
WLog_ERR(TAG, "got %" PRIuz ", expected %" PRIuz " bytes", Stream_GetRemainingLength(s), 6);
|
|
return FALSE;
|
|
}
|
|
|
|
Stream_Read_UINT16(s, marker.frameAction);
|
|
- Stream_Read_UINT32(s, marker.frameId);
|
|
+ if (Stream_GetRemainingLength(s) < 4)
|
|
+ WLog_WARN(TAG,
|
|
+ "[SERVER-BUG]: got %" PRIuz ", expected %" PRIuz
|
|
+ " bytes. [MS-RDPBCGR] 2.2.9.2.3 Frame Marker Command (TS_FRAME_MARKER) is "
|
|
+ "missing frameId, ignoring",
|
|
+ Stream_GetRemainingLength(s), 4);
|
|
+ else
|
|
+ Stream_Read_UINT32(s, marker.frameId);
|
|
WLog_Print(update->log, WLOG_DEBUG,
|
|
"SurfaceFrameMarker: action: %s (%" PRIu32 ") id: %" PRIu32 "",
|
|
(!marker.frameAction) ? "Begin" : "End", marker.frameAction, marker.frameId);
|
|
--
|
|
2.35.1
|
|
|