Don't fail the redirect if padding wasn't sent before disconnecting
authorSamuel Sieb <samuel@sieb.net>
Thu, 24 Sep 2015 17:37:21 +0000 (10:37 -0700)
committerSamuel Sieb <samuel@sieb.net>
Thu, 24 Sep 2015 17:37:21 +0000 (10:37 -0700)
libfreerdp/core/redirection.c

index f908589..6d31257 100644 (file)
@@ -359,8 +359,11 @@ BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s)
                }
        }
 
-       if (!Stream_SafeSeek(s, 8)) /* pad (8 bytes) */
-               return -1;
+       if (Stream_GetRemainingLength(s) >= 8)
+       {
+               /* some versions of windows don't included this padding before closing the connection */
+               Stream_Seek(s, 8); /* pad (8 bytes) */
+       }
 
        if (redirection->flags & LB_NOREDIRECT)
                return 0;