mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[winpr,sspi] Add type checks for negotiate_read_neg_token
check the value range of negState before using it.
This commit is contained in:
@@ -541,8 +541,21 @@ static BOOL negotiate_read_neg_token(PSecBuffer input, NegToken* token)
|
||||
WinPrAsn1_ENUMERATED rd = 0;
|
||||
if (!WinPrAsn1DecReadEnumerated(&dec2, &rd))
|
||||
return FALSE;
|
||||
token->negState = rd;
|
||||
WLog_DBG(TAG, "\tnegState [0] (%d)", token->negState);
|
||||
switch (rd)
|
||||
{
|
||||
case NOSTATE:
|
||||
case ACCEPT_COMPLETED:
|
||||
case ACCEPT_INCOMPLETE:
|
||||
case REJECT:
|
||||
case REQUEST_MIC:
|
||||
break;
|
||||
default:
|
||||
WLog_ERR(TAG, "Invalid negState enumeration value %d", rd);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
token->negState = WINPR_ASSERTING_INT_CAST(enum NegState, rd);
|
||||
WLog_DBG(TAG, "\tnegState [0] (%d)", rd);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user