From 4fde25f4d28399b79fc209869ad8d98a20aa1b0e Mon Sep 17 00:00:00 2001 From: "sidchat@google.com" Date: Fri, 17 Oct 2008 18:36:48 +0000 Subject: 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 --- chrome/browser/spellchecker.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'chrome') 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); } -- cgit v1.1