From 77059f7db11d31fb7a144b3f4e4d4a93c1d6fd67 Mon Sep 17 00:00:00 2001
From: "amit@chromium.org"
 <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Sun, 28 Feb 2010 06:16:00 +0000
Subject: Fix a crash in ChromeActiveDocument::IOleObject_SetClientSite. Check
 validity of existing document soite before QI for doc host handler.

BUG=37008
TEST=none
TBR=ananta

Review URL: http://codereview.chromium.org/660255

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40235 0039d316-1c4b-4281-b951-d872f2087c98
---
 chrome_frame/chrome_active_document.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'chrome_frame')

diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index 886c9df..d92fea7 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -386,7 +386,9 @@ HRESULT ChromeActiveDocument::IOleObject_SetClientSite(
     }
 
     ScopedComPtr<IDocHostUIHandler> doc_host_handler;
-    doc_host_handler.QueryFrom(doc_site_);
+    if (doc_site_) {
+      doc_host_handler.QueryFrom(doc_site_);
+    }
 
     if (doc_host_handler.get()) {
       doc_host_handler->HideUI();
-- 
cgit v1.1