Commit b2aa9cee authored by tsepez@chromium.org's avatar tsepez@chromium.org

Fix UAF in chrome_pdf::Instance::GetURL()

The instance owns the engine via its engine_ scoped_ptr, so if the engine is 
being destroyed via the scoped_ptr destructor, it may not be safe to access 
anything in the instance since the instance may be partially destroyed. Instead,
destroy the engine as the first step in the process so the instance is still
intact.

BUG=392956

Review URL: https://codereview.chromium.org/427583003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287955 0039d316-1c4b-4281-b951-d872f2087c98
parent 82307f6b
......@@ -307,6 +307,9 @@ Instance::Instance(PP_Instance instance)
}
Instance::~Instance() {
// The engine may try to access this instance during its destruction.
// Make sure this happens early while the instance is still intact.
engine_.reset();
RemovePerInstanceObject(kPPPPdfInterface, this);
}
......
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