[core,tpkt] log too large tpkt stream length
This commit is contained in:
parent
d5eecda8a3
commit
55f200f1b5
@ -132,8 +132,14 @@ BOOL tpkt_read_header(wStream* s, UINT16* length)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL tpkt_ensure_stream_consumed_(wStream* s, UINT16 length, const char* fkt)
|
BOOL tpkt_ensure_stream_consumed_(wStream* s, size_t length, const char* fkt)
|
||||||
{
|
{
|
||||||
|
if (length > UINT16_MAX)
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "[%s] length %" PRIuz " > %" PRIu16, fkt, length, UINT16_MAX);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
size_t rem = Stream_GetRemainingLength(s);
|
size_t rem = Stream_GetRemainingLength(s);
|
||||||
if (rem > 0)
|
if (rem > 0)
|
||||||
{
|
{
|
||||||
|
@ -32,6 +32,6 @@ FREERDP_LOCAL int tpkt_verify_header(wStream* s);
|
|||||||
FREERDP_LOCAL BOOL tpkt_read_header(wStream* s, UINT16* length);
|
FREERDP_LOCAL BOOL tpkt_read_header(wStream* s, UINT16* length);
|
||||||
FREERDP_LOCAL BOOL tpkt_write_header(wStream* s, UINT16 length);
|
FREERDP_LOCAL BOOL tpkt_write_header(wStream* s, UINT16 length);
|
||||||
#define tpkt_ensure_stream_consumed(s, length) tpkt_ensure_stream_consumed_((s), (length), __func__)
|
#define tpkt_ensure_stream_consumed(s, length) tpkt_ensure_stream_consumed_((s), (length), __func__)
|
||||||
FREERDP_LOCAL BOOL tpkt_ensure_stream_consumed_(wStream* s, UINT16 length, const char* fkt);
|
FREERDP_LOCAL BOOL tpkt_ensure_stream_consumed_(wStream* s, size_t length, const char* fkt);
|
||||||
|
|
||||||
#endif /* FREERDP_LIB_CORE_TPKT_H */
|
#endif /* FREERDP_LIB_CORE_TPKT_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user