From 149b9bf2cc799d7ff581be497c36d311787c1030 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 18 Oct 2021 09:43:57 +0200 Subject: [PATCH] Fixed StreamStaticInit warnings. --- server/proxy/pf_client.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/proxy/pf_client.c b/server/proxy/pf_client.c index bb8f7ccfe..6bfbfbd7b 100644 --- a/server/proxy/pf_client.c +++ b/server/proxy/pf_client.c @@ -378,13 +378,13 @@ static BOOL pf_client_receive_channel_data_hook(freerdp* instance, UINT16 channe (strncmp(channel_name, DRDYNVC_SVC_CHANNEL_NAME, CHANNEL_NAME_LEN + 1) == 0)) { BYTE cmd, first; - wStream s; + wStream *s, sbuffer; - Stream_StaticInit(&s, xdata, xsize); - if (Stream_Length(&s) < 1) + s = Stream_StaticConstInit(&sbuffer, xdata, xsize); + if (Stream_Length(s) < 1) return FALSE; - Stream_Read_UINT8(&s, first); + Stream_Read_UINT8(s, first); cmd = first >> 4; if (cmd == CREATE_REQUEST_PDU) @@ -397,26 +397,26 @@ static BOOL pf_client_receive_channel_data_hook(freerdp* instance, UINT16 channe switch (cbId) { case 0x00: - if (Stream_GetRemainingLength(&s) < 1) + if (Stream_GetRemainingLength(s) < 1) return FALSE; - Stream_Read_UINT8(&s, dynChannelId); + Stream_Read_UINT8(s, dynChannelId); break; case 0x01: - if (Stream_GetRemainingLength(&s) < 2) + if (Stream_GetRemainingLength(s) < 2) return FALSE; - Stream_Read_UINT16(&s, dynChannelId); + Stream_Read_UINT16(s, dynChannelId); break; case 0x02: - if (Stream_GetRemainingLength(&s) < 4) + if (Stream_GetRemainingLength(s) < 4) return FALSE; - Stream_Read_UINT32(&s, dynChannelId); + Stream_Read_UINT32(s, dynChannelId); break; default: return FALSE; } - name = (const char*)Stream_Pointer(&s); - nameLen = Stream_GetRemainingLength(&s); + name = (const char*)Stream_Pointer(s); + nameLen = Stream_GetRemainingLength(s); len = strnlen(name, nameLen); if ((len == 0) || (len == nameLen)) return FALSE;