mirror of https://github.com/FreeRDP/FreeRDP
libfreerdp-core: TPKT length is big-endian.
This commit is contained in:
parent
5036f150e4
commit
addc192965
|
@ -116,5 +116,14 @@ stream_extend(STREAM * stream);
|
||||||
(((uint64)(*(_s->ptr + 7))) << 56); \
|
(((uint64)(*(_s->ptr + 7))) << 56); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define stream_read_uint16_be(_s, _v) do { _v = \
|
||||||
|
(((uint16)(*_s->ptr)) << 8) + \
|
||||||
|
(uint16)(*(_s->ptr + 1)); \
|
||||||
|
_s->ptr += 2; } while (0)
|
||||||
|
|
||||||
|
#define stream_write_uint16_be(_s, _v) do { \
|
||||||
|
*_s->ptr++ = ((_v) >> 8) & 0xFF; \
|
||||||
|
*_s->ptr++ = (_v) & 0xFF; } while (0)
|
||||||
|
|
||||||
#endif /* __STREAM_UTILS_H */
|
#endif /* __STREAM_UTILS_H */
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ tpkt_read_header(STREAM* s)
|
||||||
if (version == 3)
|
if (version == 3)
|
||||||
{
|
{
|
||||||
stream_seek(s, 2);
|
stream_seek(s, 2);
|
||||||
stream_read_uint16(s, length);
|
stream_read_uint16_be(s, length);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -80,5 +80,5 @@ tpkt_write_header(STREAM* s, int length)
|
||||||
{
|
{
|
||||||
stream_write_uint8(s, 3); /* version */
|
stream_write_uint8(s, 3); /* version */
|
||||||
stream_write_uint8(s, 8); /* reserved */
|
stream_write_uint8(s, 8); /* reserved */
|
||||||
stream_write_uint16(s, length); /* length */
|
stream_write_uint16_be(s, length); /* length */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue