libfreerdp-core: fix redirection with standard RDP security
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 21 Sep 2015 19:36:19 +0000 (15:36 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 21 Sep 2015 19:36:19 +0000 (15:36 -0400)
libfreerdp/core/redirection.c

index f75a094..f908589 100644 (file)
@@ -387,8 +387,11 @@ int rdp_recv_enhanced_security_redirection_packet(rdpRdp* rdp, wStream* s)
        if (status < 0)
                return status;
 
-       if (!Stream_SafeSeek(s, 1)) /* pad2Octets (1 byte) */
-               return -1;
+       if (Stream_GetRemainingLength(s) >= 1)
+       {
+               /* this field is optional, and its absence is not an error */
+               Stream_Seek(s, 1); /* pad2Octets (1 byte) */
+       }
 
        return status;
 }