FreeRDP/libfreerdp
Zavadovsky Yan 2be175cec4 libfreerdp-core: fix dead-end state in transport_read_pdu()
Situation: we have fragmented TPKT PDU without two last bytes
(or one last byte - for fast-path) in network stack.

First call to transport_read_pdu() works normally, read
available bytes and exit with status 0 - no whole PDU readed.

Before second call this missed bytes arrive.
Optionally with next PDU.

In second call header parsing code unconditionally read this
two bytes(one byte) despite this is not header bytes.
And increase stream position, so stream now contains whole PDU.

This cause (pduLength - Stream_GetPosition(s)) calculation to be 0.
So transport_read_layer_bytes()-->transport_read_layer() return 0
and transport_read_pdu() exits with "not enough data is available"
status.

If next PDU isn't available next calls to transport_read_pdu()
give same result.
If next PDU arrive - (pduLength - Stream_GetPosition(s)) will be
less than 0. Stream position will grow, grow and grow on each call.
And transport_read_pdu() never signals that PDU is readed.

Caught on Android FreeRDP client with high RDP traffic (several MBytes/s).
2015-02-22 00:28:22 +03:00
..
cache gfx/pointer: add support to set pointer 2015-02-02 10:57:31 +01:00
codec Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-02-06 18:02:10 -05:00
common libfreerdp-core: add channel reconnect 2015-02-06 17:35:14 -05:00
core libfreerdp-core: fix dead-end state in transport_read_pdu() 2015-02-22 00:28:22 +03:00
crypto libfreerdp-core: fix BIO leaks 2015-02-18 15:36:57 -05:00
gdi Updated h264_decompress arguments. 2015-01-22 13:24:15 +01:00
locale Forward layout ID of Programmer Dvorak to server 2015-01-30 21:22:59 +01:00
primitives Merge branch 'master' of github.com:awakecoding/FreeRDP into egfx 2014-09-17 19:09:56 -04:00
utils ringbuffer: add option to enable/disable debugging 2015-02-03 15:28:05 +01:00
CMakeLists.txt libfreerdp-rail: remove 2014-11-12 19:51:17 -05:00