summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_creator.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-16 13:44:20 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-16 13:44:20 +0000
commit0f57d2f28d222f8160101f72228575666b22993e (patch)
treed1081c1268262350a38966c3f26e26c7a725de5c /chrome/browser/extensions/extension_creator.cc
parent3693df59ae0e5b86ff59f24061e4937b16efe80a (diff)
downloadchromium_src-0f57d2f28d222f8160101f72228575666b22993e.zip
chromium_src-0f57d2f28d222f8160101f72228575666b22993e.tar.gz
chromium_src-0f57d2f28d222f8160101f72228575666b22993e.tar.bz2
Fix a crash in the Extension Creator when crx is in use.
BUG=92537 TEST=Create a .crx file from within Chrome, open it up with 7-zip and edit one of the files within (to lock the crx file), then try recreating the crx file -- an error should appear (and no crash). Review URL: http://codereview.chromium.org/7618044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_creator.cc')
-rw-r--r--chrome/browser/extensions/extension_creator.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_creator.cc b/chrome/browser/extensions/extension_creator.cc
index 1a90d31..6cf0f4f 100644
--- a/chrome/browser/extensions/extension_creator.cc
+++ b/chrome/browser/extensions/extension_creator.cc
@@ -192,6 +192,10 @@ bool ExtensionCreator::WriteCRX(const FilePath& zip_path,
if (file_util::PathExists(crx_path))
file_util::Delete(crx_path, false);
ScopedStdioHandle crx_handle(file_util::OpenFile(crx_path, "wb"));
+ if (!crx_handle.get()) {
+ error_message_ = l10n_util::GetStringUTF8(IDS_EXTENSION_SHARING_VIOLATION);
+ return false;
+ }
std::vector<uint8> public_key;
if (!private_key->ExportPublicKey(&public_key)) {