[warnings] fix integer narrowing
This commit is contained in:
parent
69b9f81c29
commit
eea56dcf60
@ -972,8 +972,10 @@ static SSIZE_T rdstls_parse_pdu_data_type(wLog* log, UINT16 dataType, wStream* s
|
||||
return 0;
|
||||
Stream_Read_UINT16(s, passwordLength);
|
||||
|
||||
return Stream_GetPosition(s) + passwordLength;
|
||||
if (!Stream_SafeSeek(s, passwordLength))
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case RDSTLS_DATA_AUTORECONNECT_COOKIE:
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < 4)
|
||||
@ -984,13 +986,19 @@ static SSIZE_T rdstls_parse_pdu_data_type(wLog* log, UINT16 dataType, wStream* s
|
||||
if (Stream_GetRemainingLength(s) < 2)
|
||||
return 0;
|
||||
Stream_Read_UINT16(s, cookieLength);
|
||||
|
||||
return 12u + cookieLength;
|
||||
if (!Stream_SafeSeek(s, cookieLength))
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WLog_Print(log, WLOG_ERROR, "invalid RDSLTS dataType");
|
||||
return -1;
|
||||
}
|
||||
|
||||
const size_t len = Stream_GetPosition(s);
|
||||
if (len > SSIZE_MAX)
|
||||
return 0;
|
||||
return (SSIZE_T)len;
|
||||
}
|
||||
|
||||
SSIZE_T rdstls_parse_pdu(wLog* log, wStream* stream)
|
||||
|
Loading…
Reference in New Issue
Block a user