Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5360)

Unified Diff: chrome/browser/spellchecker.cc

Issue 326012: Check word lengths before adding to dictionary and spellchecking.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Audited the code more and determined that a more conservative maximum is need... Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker.cc
===================================================================
--- chrome/browser/spellchecker.cc (revision 30490)
+++ chrome/browser/spellchecker.cc (working copy)
@@ -840,7 +840,7 @@
// 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())
@@ -869,7 +869,7 @@
} 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698