From 8a06ed929981838ae1559b48d822758c3a52b2d3 Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Mon, 16 May 2022 11:13:22 +0000 Subject: [PATCH] proxy: Reset stream position before length check --- server/proxy/channels/pf_channel_smartcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/proxy/channels/pf_channel_smartcard.c b/server/proxy/channels/pf_channel_smartcard.c index e0b758850..cc2ba33f7 100644 --- a/server/proxy/channels/pf_channel_smartcard.c +++ b/server/proxy/channels/pf_channel_smartcard.c @@ -81,9 +81,9 @@ static BOOL pf_channel_client_write_iostatus(wStream* out, const SMARTCARD_OPERA WINPR_ASSERT(out); pos = Stream_GetPosition(out); + Stream_SetPosition(out, 0); if (!Stream_CheckAndLogRequiredLength(TAG, out, 16)) return FALSE; - Stream_SetPosition(out, 0); Stream_Read_UINT16(out, component); Stream_Read_UINT16(out, packetid);