Skip to content

Commit

Permalink
datapath-windows: Remove Strsafe usage from datapath
Browse files Browse the repository at this point in the history
The removal is mandatory to use the VStudio 2013 static code analyzer.

The only function that was used from the include is: 'StringCbLengthA'.
We were not checking the result of that function, nor will the
'vportGet->name' exceed the 'OVS_MAX_PORT_NAME_LENGTH' limitation.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-By: Anand Kumar <kumaranand@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
  • Loading branch information
Alin Serdean authored and shettyg committed May 25, 2017
1 parent c052756 commit ad91a8e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion datapath-windows/ovsext/Netlink/NetlinkBuf.c
Expand Up @@ -40,7 +40,6 @@
#include <intsafe.h>
#include <ntintsafe.h>
#include <ntstrsafe.h>
#include <Strsafe.h>

#ifdef OVS_DBG_MOD
#undef OVS_DBG_MOD
Expand Down
2 changes: 0 additions & 2 deletions datapath-windows/ovsext/Vport.c
Expand Up @@ -1618,15 +1618,13 @@ OvsGetExtInfoIoctl(POVS_VPORT_GET vportGet,
POVS_VPORT_EXT_INFO extInfo)
{
POVS_VPORT_ENTRY vport;
size_t len;
LOCK_STATE_EX lockState;
NTSTATUS status = STATUS_SUCCESS;
BOOLEAN doConvert = FALSE;

RtlZeroMemory(extInfo, sizeof (POVS_VPORT_EXT_INFO));
NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0);
if (vportGet->portNo == 0) {
StringCbLengthA(vportGet->name, OVS_MAX_PORT_NAME_LENGTH - 1, &len);
vport = OvsFindVportByHvNameA(gOvsSwitchContext, vportGet->name);
if (vport == NULL) {
/* If the port is not a Hyper-V port and it has been added earlier,
Expand Down
1 change: 0 additions & 1 deletion datapath-windows/ovsext/precomp.h
Expand Up @@ -19,7 +19,6 @@
#include <intsafe.h>
#include <ntintsafe.h>
#include <ntstrsafe.h>
#include <Strsafe.h>

#include "Types.h"

Expand Down

0 comments on commit ad91a8e

Please sign in to comment.