| Index: src/plugin/PluginWbPassThrough.cpp |
| =================================================================== |
| --- a/src/plugin/PluginWbPassThrough.cpp |
| +++ b/src/plugin/PluginWbPassThrough.cpp |
| @@ -13,7 +13,7 @@ |
| namespace |
| { |
| - std::string g_blockedByABPPage = "<!DOCTYPE html>" |
| + const std::string g_blockedByABPPage = "<!DOCTYPE html>" |
| "<html>" |
| "<body>" |
| "<!-- blocked by AdblockPlus -->" |
| @@ -43,7 +43,7 @@ |
| // only HTTP_QUERY_RAW_HEADERS_CRLF | HTTP_QUERY_FLAG_REQUEST_HEADERS does work. |
| ATL::CComPtr<IWinInetHttpInfo> winInetHttpInfo; |
| HRESULT hr = internetProtocol->QueryInterface(&winInetHttpInfo); |
| - if (FAILED(hr)) |
| + if (FAILED(hr) || !winInetHttpInfo) |
| { |
| return ""; |
| } |
| @@ -181,11 +181,7 @@ |
| HRESULT WBPassthruSink::OnRead(void* pv, ULONG cb, ULONG* pcbRead) |
| { |
| - if (pv == nullptr) |
| - { |
| - return E_POINTER; |
| - } |
| - if (pcbRead == nullptr) |
| + if (!pv || !pcbRead) |
| { |
| return E_POINTER; |
| } |
| @@ -278,6 +274,10 @@ |
| STDMETHODIMP WBPassthruSink::BeginningTransaction(LPCWSTR szURL, LPCWSTR szHeaders, DWORD dwReserved, LPWSTR* pszAdditionalHeaders) |
| { |
| + if (!szURL) |
| + { |
| + return E_POINTER; |
| + } |
| std::wstring src = szURL; |
| DEBUG_GENERAL(ToCString(src)); |
| @@ -390,14 +390,4 @@ |
| { |
| WBPassthruSink* pSink = GetSink(); |
| return pSink->OnRead(pv, cb, pcbRead); |
| -} |
| - |
| -STDMETHODIMP WBPassthru::LockRequest(/* [in] */ DWORD options) |
| -{ |
| - return BaseClass::LockRequest(options); |
| -} |
| - |
| -STDMETHODIMP WBPassthru::UnlockRequest() |
| -{ |
| - return BaseClass::UnlockRequest(); |
| } |