diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-11 21:54:47 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-11 21:54:47 +0000 |
commit | a9122956f932ea606843d43aa3fc8a4a4f91f7ed (patch) | |
tree | bc7b0f4e54af9bb27788519ad0b460722ec8783a /chrome | |
parent | 417336c5ab6c869c854dc91157ca1e9416916688 (diff) | |
download | chromium_src-a9122956f932ea606843d43aa3fc8a4a4f91f7ed.zip chromium_src-a9122956f932ea606843d43aa3fc8a4a4f91f7ed.tar.gz chromium_src-a9122956f932ea606843d43aa3fc8a4a4f91f7ed.tar.bz2 |
Fixing bug 1951: Browser crash on View-Source of an https page.
http://code.google.com/p/chromium/issues/detail?id=1951
We load the page in view-source mode, then request the favicon to show in the tab. The SSLManager gets notified about OnRequestStarted for both the page and the favicon, but the favicon request gets redirected from:
https://www.solomobile.ca/favicon.ico
... to ...
http://www.solomobile.ca/Error.aspx?aspxerrorpath=/Page-Not-Found.aspx
The SSLManager sees this as mixed content and while handling that it writes a debug message to the console, but in the process of writing the debug message we crash when GetTabContents(TAB_CONTENTS_WEB) returns NULL (since the current tab is TAB_CONTENTS_VIEW_SOURCE). Given that this is a debug message we are trying to write with a function that is only implemented on WebContents we should just NULL check the GetTabContents(TAB_CONTENTS_WEB) return value (and not log the debug message).
Review URL: http://codereview.chromium.org/2445
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2090 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/ssl_manager.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/ssl_manager.cc b/chrome/browser/ssl_manager.cc index eabecb3..77b8c12 100644 --- a/chrome/browser/ssl_manager.cc +++ b/chrome/browser/ssl_manager.cc @@ -62,7 +62,7 @@ class SSLInfoBar : public InfoBarItemView, SSLManager* manager_; scoped_ptr<Task> task_; - DISALLOW_EVIL_CONSTRUCTORS(SSLInfoBar); + DISALLOW_COPY_AND_ASSIGN(SSLInfoBar); }; SSLInfoBar::SSLInfoBar(SSLManager* manager, @@ -232,15 +232,16 @@ bool SSLManager::SetMaxSecurityStyle(SecurityStyle style) { // Delegate API method. void SSLManager::AddMessageToConsole(const std::wstring& msg, ConsoleMessageLevel level) { - WebContents* web_contents = - controller_->GetTabContents(TAB_CONTENTS_WEB)->AsWebContents(); + TabContents* tab_contents = controller_->GetTabContents(TAB_CONTENTS_WEB); + if (!tab_contents) + return; + WebContents* web_contents = tab_contents->AsWebContents(); if (!web_contents) return; web_contents->AddMessageToConsole(std::wstring(), msg, level); } - // Delegate API method. void SSLManager::DenyCertForHost(net::X509Certificate* cert, const std::string& host) { |