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

Unified Diff: src/hunspell/hunspell.cxx

Issue 11442040: Fix array-out-of-bounds error in hunspell (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/hunspell.git@master
Patch Set: Merge with master Created 8 years 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 | « google.patch ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hunspell/hunspell.cxx
diff --git a/src/hunspell/hunspell.cxx b/src/hunspell/hunspell.cxx
index 0d606e083f5f558aa77130f1fe2b5e9f0643c2b5..b3f37394a7b3ce64541851afd0cb9ccdea1dc61a 100644
--- a/src/hunspell/hunspell.cxx
+++ b/src/hunspell/hunspell.cxx
@@ -137,7 +137,9 @@ int Hunspell::cleanword2(char * dest, const char * src,
if (utf8) {
*nc = u8_u16(dest_utf, MAXWORDLEN, dest);
// don't check too long words
- if (*nc >= MAXWORDLEN) return 0;
+ // TODO(rouslan): Remove the interim change below when this patch lands:
+ // http://sf.net/tracker/?func=detail&aid=3595024&group_id=143754&atid=756395.
+ if (*nc >= MAXWORDLEN - 1) return 0;
if (*nc == -1) { // big Unicode character (non BMP area)
*pcaptype = NOCAP;
return nl;
« no previous file with comments | « google.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698