Skip to content

Commit 91ef44e

Browse files
committed
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
1 parent 704289f commit 91ef44e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

libfreerdp/core/surface.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,21 @@ static BOOL update_recv_surfcmd_frame_marker(rdpUpdate* update, wStream* s)
171171

172172
WINPR_ASSERT(s);
173173

174-
if (Stream_GetRemainingLength(s) < 6)
174+
if (Stream_GetRemainingLength(s) < 2)
175175
{
176176
WLog_ERR(TAG, "got %" PRIuz ", expected %" PRIuz " bytes", Stream_GetRemainingLength(s), 6);
177177
return FALSE;
178178
}
179179

180180
Stream_Read_UINT16(s, marker.frameAction);
181-
Stream_Read_UINT32(s, marker.frameId);
181+
if (Stream_GetRemainingLength(s) < 4)
182+
WLog_WARN(TAG,
183+
"[SERVER-BUG]: got %" PRIuz ", expected %" PRIuz
184+
" bytes. [MS-RDPBCGR] 2.2.9.2.3 Frame Marker Command (TS_FRAME_MARKER) is "
185+
"missing frameId, ignoring",
186+
Stream_GetRemainingLength(s), 4);
187+
else
188+
Stream_Read_UINT32(s, marker.frameId);
182189
WLog_Print(up->log, WLOG_DEBUG, "SurfaceFrameMarker: action: %s (%" PRIu32 ") id: %" PRIu32 "",
183190
(!marker.frameAction) ? "Begin" : "End", marker.frameAction, marker.frameId);
184191

0 commit comments

Comments
 (0)