Kaydet (Commit) 07a70e84 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 (PVS): compare BSTR to wchar_t[] directly

V505 The 'alloca' function is used inside the loop. This can quickly overflow
     stack.

Change-Id: I57773664000df0f5329f957674661a2313205223
Reviewed-on: https://gerrit.libreoffice.org/62038
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 76a25639
......@@ -76,8 +76,7 @@ STDMETHODIMP SODispatchInterceptor::queryDispatch( IDispatch FAR* aURL,
if( aTargetUrl.vt != VT_BSTR ) return E_FAIL;
USES_CONVERSION;
if( !strncmp( OLE2T( aTargetUrl.bstrVal ), ".uno:OpenHyperlink", 18 ) )
if (!wcsncmp(aTargetUrl.bstrVal, L".uno:OpenHyperlink", 18))
{
CComQIPtr< IDispatch, &IID_IDispatch > pIDisp( this );
if( pIDisp )
......@@ -167,8 +166,7 @@ STDMETHODIMP SODispatchInterceptor::dispatch( IDispatch FAR* aURL, SAFEARRAY FAR
if( pValue.vt != VT_BSTR || pValue.bstrVal == nullptr )
return E_FAIL;
USES_CONVERSION;
if( !strncmp( OLE2T( pValue.bstrVal ), ".uno:OpenHyperlink", 18 ) )
if (!wcsncmp(pValue.bstrVal, L".uno:OpenHyperlink", 18))
{
long nLB = 0, nUB = 0;
// long nDim = SafeArrayGetDim( aArgs );
......@@ -193,7 +191,7 @@ STDMETHODIMP SODispatchInterceptor::dispatch( IDispatch FAR* aURL, SAFEARRAY FAR
if( pValues[0].vt == VT_BSTR && pValues[1].vt == VT_BSTR )
{
if( !strncmp( OLE2T( pValues[0].bstrVal ), "URL", 3 ) )
if (!wcsncmp(pValues[0].bstrVal, L"URL", 3))
{
EnterCriticalSection( &mMutex );
if( m_xParentControl )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment