Fix buffer overflow in windows tap driver

This commit is contained in:
Joseph Henry 2020-09-23 15:31:20 -07:00
parent ff23d3051f
commit b3331c5ec2

View File

@ -272,7 +272,8 @@ tapReadConfiguration(
if (status == NDIS_STATUS_SUCCESS)
{
if (configParameter->ParameterType == NdisParameterString)
if (configParameter->ParameterType == NdisParameterString
&& configParameter->ParameterData.StringData.Length <= sizeof(Adapter->NetCfgInstanceIdBuffer) - sizeof(WCHAR))
{
DEBUGP (("[TAP] NdisReadConfiguration (NetCfgInstanceId=%wZ)\n",
&configParameter->ParameterData.StringData ));