Avoid buffer to struct cast.
authorPavel Pautov <37922380+p-pautov@users.noreply.github.com>
Thu, 5 Apr 2018 20:12:20 +0000 (13:12 -0700)
committerPavel Pautov <37922380+p-pautov@users.noreply.github.com>
Tue, 17 Apr 2018 02:06:16 +0000 (19:06 -0700)
libfreerdp/core/gateway/rdg.c

index 178a14d..3dab0f4 100755 (executable)
@@ -113,7 +113,8 @@ static wStream* rdg_receive_packet(rdpRdg* rdg)
                return NULL;
        }
 
-       packetLength = ((RdgPacketHeader*)Stream_Buffer(s))->packetLength;
+       Stream_Seek(s, 4);
+       Stream_Read_UINT32(s, packetLength);
 
        if (!Stream_EnsureCapacity(s, packetLength))
        {