diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-20 08:23:10 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-20 09:24:13 +0200 |
commit | 07a70e84f21ef2a69d8b7a69a1bd3844a0c362f5 (patch) | |
tree | b6b1dbee9227bb5b973f5486389dc59fbd37a38a /extensions | |
parent | 76a25639474c50c34a2b84ba1f357013de5ddae8 (diff) |
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: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/activex/SODispatchInterceptor.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/extensions/source/activex/SODispatchInterceptor.cxx b/extensions/source/activex/SODispatchInterceptor.cxx index ed610c56da8f..8cfe36c9e981 100644 --- a/extensions/source/activex/SODispatchInterceptor.cxx +++ b/extensions/source/activex/SODispatchInterceptor.cxx @@ -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 ) |