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

Unified Diff: chrome/third_party/hunspell/src/hunspell/affixmgr.cxx

Issue 115228: Try to fix a crash in Hunspell. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « chrome/third_party/hunspell/src/hunspell/affentry.cxx ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/third_party/hunspell/src/hunspell/affixmgr.cxx
===================================================================
--- chrome/third_party/hunspell/src/hunspell/affixmgr.cxx (revision 15859)
+++ chrome/third_party/hunspell/src/hunspell/affixmgr.cxx (working copy)
@@ -1139,6 +1139,12 @@
neg = 0;
}
n++;
+ if (n > 8) {
+ HUNSPELL_WARNING(stderr, "Number of conditions is larger than 8. This"
+ "version of Hunspell does not support more than 8 conditions."
+ "Please, get rid of affentries with more than 8 conditions.");
+ break;
+ }
ec = 0;
neg = 0;
}
@@ -3777,7 +3783,7 @@
free(err);
return 1;
}
- ptr = (struct affentry *) malloc(numents * sizeof(struct affentry));
+ ptr = (struct affentry *) calloc(numents, sizeof(struct affentry));
if (!ptr) return 1;
ptr->opts = ff;
if (utf8) ptr->opts += aeUTF8;
« no previous file with comments | « chrome/third_party/hunspell/src/hunspell/affentry.cxx ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698