Explorar el Código

Fix buffer overflow in windows tap driver

Joseph Henry hace 4 años
padre
commit
b3331c5ec2
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      windows/TapDriver6/adapter.c

+ 2 - 1
windows/TapDriver6/adapter.c

@@ -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 ));