core: Remove redundant stream position changes
authorOndrej Holy <oholy@redhat.com>
Tue, 19 Dec 2017 12:02:55 +0000 (13:02 +0100)
committerOndrej Holy <oholy@redhat.com>
Tue, 19 Dec 2017 12:02:55 +0000 (13:02 +0100)
Stream_Seek() is used, but consequently Stream_SetPosition() is used
for position obtained by Stream_GetPosition() immediatelly before
Stream_Seek(). Let's remove this stream position changes due to its
redundancy.

libfreerdp/core/rdp.c

index ebd6de5..767f894 100644 (file)
@@ -615,17 +615,11 @@ BOOL rdp_send_data_pdu(rdpRdp* rdp, wStream* s, BYTE type, UINT16 channel_id)
 BOOL rdp_send_message_channel_pdu(rdpRdp* rdp, wStream* s, UINT16 sec_flags)
 {
        UINT16 length;
-       UINT32 sec_bytes;
-       size_t sec_hold;
        UINT32 pad;
 
        length = Stream_GetPosition(s);
        Stream_SetPosition(s, 0);
        rdp_write_header(rdp, s, length, rdp->mcs->messageChannelId);
-       sec_bytes = rdp_get_sec_bytes(rdp, sec_flags);
-       sec_hold = Stream_GetPosition(s);
-       Stream_Seek(s, sec_bytes);
-       Stream_SetPosition(s, sec_hold);
 
        if (!rdp_security_stream_out(rdp, s, length, sec_flags, &pad))
                return FALSE;