]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath-windows: interfaceName overflow in IpHelper
authorAlin Serdean <aserdean@cloudbasesolutions.com>
Fri, 14 Jul 2017 04:40:52 +0000 (04:40 +0000)
committerBen Pfaff <blp@ovn.org>
Wed, 2 Aug 2017 18:25:25 +0000 (11:25 -0700)
Bump the size of interfaceName so an overflow cannot occur when using
`ConvertInterfaceLuidToAlias`.

Found using WDK 10 static code analysis.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Shashank Ram <rams@vmware.com>
datapath-windows/ovsext/IpHelper.c

index 2897e10d638f0f84f6ec6144d149311b4526230a..e98dcd1bd9c91105d22d2347d042b54bb79edf35 100644 (file)
@@ -369,7 +369,7 @@ OvsGetRoute(SOCKADDR_INET *destinationAddress,
         SOCKADDR_INET crtSrcAddr = { 0 };
         MIB_IPFORWARD_ROW2 crtRoute = { 0 };
         POVS_IPHELPER_INSTANCE crtInstance = NULL;
-        WCHAR interfaceName[IF_MAX_STRING_SIZE] = { 0 };
+        WCHAR interfaceName[IF_MAX_STRING_SIZE + 1] = { 0 };
 
         crtInstance = CONTAINING_RECORD(link, OVS_IPHELPER_INSTANCE, link);
 
@@ -608,7 +608,7 @@ OvsAddIpInterfaceNotification(PMIB_IPINTERFACE_ROW ipRow)
 
         InitializeListHead(&instance->link);
         ExInitializeResourceLite(&instance->lock);
-        WCHAR interfaceName[IF_MAX_STRING_SIZE] = { 0 };
+        WCHAR interfaceName[IF_MAX_STRING_SIZE + 1] = { 0 };
         status = ConvertInterfaceLuidToAlias(&ipRow->InterfaceLuid,
                                              interfaceName,
                                              IF_MAX_STRING_SIZE + 1);