Fixed oob read in ntlm_read_NegotiateMessage

This commit is contained in:
akallabeth 2020-04-15 16:48:50 +02:00
parent b230ac98e9
commit 8fa3835963
1 changed files with 5 additions and 0 deletions

View File

@ -219,6 +219,11 @@ SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buf
return SEC_E_INVALID_TOKEN;
}
if (Stream_GetRemainingLength(s) < 4)
{
Stream_Free(s, FALSE);
return SEC_E_INVALID_TOKEN;
}
Stream_Read_UINT32(s, message->NegotiateFlags); /* NegotiateFlags (4 bytes) */
if (!((message->NegotiateFlags & NTLMSSP_REQUEST_TARGET) &&