server/rdpgfx_main.c: Fixed caps advertise PDU recv (#5304)
authorMati Shabtay <35010736+m4ntis@users.noreply.github.com>
Fri, 15 Mar 2019 07:37:35 +0000 (09:37 +0200)
committerakallabeth <akallabeth@users.noreply.github.com>
Fri, 15 Mar 2019 07:37:35 +0000 (08:37 +0100)
channels/rdpgfx/server/rdpgfx_main.c

index 7542522..0990d94 100644 (file)
@@ -1194,7 +1194,6 @@ static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context,
        RDPGFX_CAPSET* capsSets;
        RDPGFX_CAPS_ADVERTISE_PDU pdu;
        UINT error = CHANNEL_RC_OK;
-       UINT32 capsDataLength;
 
        if (Stream_GetRemainingLength(s) < 2)
        {
@@ -1221,9 +1220,9 @@ static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context,
        {
                RDPGFX_CAPSET* capsSet = &(pdu.capsSets[index]);
                Stream_Read_UINT32(s, capsSet->version); /* version (4 bytes) */
-               Stream_Read_UINT32(s, capsDataLength); /* capsDataLength (4 bytes) */
+               Stream_Read_UINT32(s, capsSet->length); /* capsDataLength (4 bytes) */
 
-               if (capsDataLength >= 4)
+               if (capsSet->length >= 4)
                        Stream_Peek_UINT32(s, capsSet->flags); /* capsData (4 bytes) */
 
                Stream_Seek(s, capsSet->length);