diff options
author | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 18:36:48 +0000 |
---|---|---|
committer | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 18:36:48 +0000 |
commit | 4fde25f4d28399b79fc209869ad8d98a20aa1b0e (patch) | |
tree | 6f857680f3cea93455168382f033625f10ac9bfb /chrome/browser/spellchecker.cc | |
parent | b4aadcc19c17caa7637a86e9723d60eb4740f9d3 (diff) | |
download | chromium_src-4fde25f4d28399b79fc209869ad8d98a20aa1b0e.zip chromium_src-4fde25f4d28399b79fc209869ad8d98a20aa1b0e.tar.gz chromium_src-4fde25f4d28399b79fc209869ad8d98a20aa1b0e.tar.bz2 |
Fix a potential crasher in SpellChecker Add to dictionary feature.
Issue=3039
Review URL: http://codereview.chromium.org/7484
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker.cc')
-rw-r--r-- | chrome/browser/spellchecker.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/spellchecker.cc b/chrome/browser/spellchecker.cc index d5a8a6c..e6cfc75 100644 --- a/chrome/browser/spellchecker.cc +++ b/chrome/browser/spellchecker.cc @@ -510,7 +510,8 @@ class AddWordToCustomDictionaryTask : public Task { // or not. word_ += "\n"; FILE* f = file_util::OpenFile(file_name_, "a+"); - fputs(word_.c_str(), f); + if (f != NULL) + fputs(word_.c_str(), f); file_util::CloseFile(f); } |