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 <[email protected]>
---
 datapath-windows/ovsext/IpHelper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/datapath-windows/ovsext/IpHelper.c 
b/datapath-windows/ovsext/IpHelper.c
index 2897e10..e98dcd1 100644
--- a/datapath-windows/ovsext/IpHelper.c
+++ b/datapath-windows/ovsext/IpHelper.c
@@ -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);
-- 
2.10.2.windows.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to