summaryrefslogtreecommitdiffstats
path: root/chrome/browser/spellchecker.cc
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-03 19:23:26 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-03 19:23:26 +0000
commitea11afb6a934fff566401b1d7d6cdc0d0667f892 (patch)
treee16b317486878b3f9a1965a480bef8f7bd25c015 /chrome/browser/spellchecker.cc
parent3198deec103c43e415b05eba8f979236695cb75c (diff)
downloadchromium_src-ea11afb6a934fff566401b1d7d6cdc0d0667f892.zip
chromium_src-ea11afb6a934fff566401b1d7d6cdc0d0667f892.tar.gz
chromium_src-ea11afb6a934fff566401b1d7d6cdc0d0667f892.tar.bz2
Check word lengths before adding to dictionary and spellchecking.
BUG=20469 TEST=None Review URL: http://codereview.chromium.org/326012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30845 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker.cc')
-rw-r--r--chrome/browser/spellchecker.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/spellchecker.cc b/chrome/browser/spellchecker.cc
index b674ed8..11142d0 100644
--- a/chrome/browser/spellchecker.cc
+++ b/chrome/browser/spellchecker.cc
@@ -765,7 +765,7 @@ void SpellChecker::AddWord(const string16& word) {
// Add the word to hunspell.
std::string word_to_add = UTF16ToUTF8(word);
// Don't attempt to add an empty word, or one larger than Hunspell can handle
- if (!word_to_add.empty() && word_to_add.length() < MAXWORDUTF8LEN) {
+ if (!word_to_add.empty() && word_to_add.length() < MAXWORDLEN) {
// Either add the word to |hunspell_|, or, if |hunspell_| is still loading,
// defer it till after the load completes.
if (hunspell_.get())
@@ -789,7 +789,7 @@ bool SpellChecker::CheckSpelling(const string16& word_to_check, int tag) {
} else {
std::string word_to_check_utf8(UTF16ToUTF8(word_to_check));
// Hunspell shouldn't let us exceed its max, but check just in case
- if (word_to_check_utf8.length() < MAXWORDUTF8LEN) {
+ if (word_to_check_utf8.length() < MAXWORDLEN) {
// |hunspell_->spell| returns 0 if the word is spelled correctly and
// non-zero otherwsie.
word_correct = (hunspell_->spell(word_to_check_utf8.c_str()) != 0);