Commit 59bee1c4 authored by treib@chromium.org's avatar treib@chromium.org

Fix a null pointer dereference in CreateProfileHandler::ShowProfileCreationError.

The ProfileManager can call its callback (which points to CreateProfileHandler::OnProfileCreated) with a NULL profile (https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/profiles/profile_manager.cc&l=397). This case was not handled in CreateProfileHandler::ShowProfileCreationError.

BUG=395558

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284667 0039d316-1c4b-4281-b951-d872f2087c98
parent 5b6dc4f8
......@@ -283,6 +283,8 @@ void CreateProfileHandler::ShowProfileCreationError(
web_ui()->CallJavascriptFunction(
GetJavascriptMethodName(PROFILE_CREATION_ERROR),
base::StringValue(error));
// The ProfileManager calls us back with a NULL profile in some cases.
if (profile)
helper::DeleteProfileAtPath(profile->GetPath(), web_ui());
}
......
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