Bug 631607 - Crash while spell checking with French modern dictionary 4.0.3 [@ mozalloc_abort(char const* const) ][@ mozalloc_abort(char const* const) | mozalloc_handle_oom() ]; r=jst a=blocking-betaN+
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 08 Feb 2011 18:01:06 -0500
changeset 62180 fd47f7c9a3b8b2df660075db31126019c919de77
parent 62179 33dc58befe48543c95e4a64e8ef3d677dad42eb0
child 62181 b0dc575e0a12eee3924c92a33cafdadedc635aab
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersjst, blocking-betaN
bugs631607
milestone2.0b12pre
Bug 631607 - Crash while spell checking with French modern dictionary 4.0.3 [@ mozalloc_abort(char const* const) ][@ mozalloc_abort(char const* const) | mozalloc_handle_oom() ]; r=jst a=blocking-betaN+
extensions/spellcheck/hunspell/src/README.hunspell
extensions/spellcheck/hunspell/src/hunspell.cpp
--- a/extensions/spellcheck/hunspell/src/README.hunspell
+++ b/extensions/spellcheck/hunspell/src/README.hunspell
@@ -31,17 +31,17 @@
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 ******* END LICENSE BLOCK *******
 
 Hunspell Version: 1.2.12
-Additional Patches: 583582, 586671, 586686, 603311, 617953, 626195
+Additional Patches: 583582, 586671, 586686, 603311, 617953, 626195, 631607
 
 Hunspell Author: László Németh
 MySpell Author: Kevin Hendricks & David Einstein
 
 Hunspell is a spell checker and morphological analyser library. Hunspell
 is based on OpenOffice.org's Myspell. Documentation, tests, and examples
 are available at http://hunspell.sourceforge.net.
 
--- a/extensions/spellcheck/hunspell/src/hunspell.cpp
+++ b/extensions/spellcheck/hunspell/src/hunspell.cpp
@@ -1008,20 +1008,22 @@ int Hunspell::suggest(char*** slst, cons
   // remove duplications
   int l = 0;
   for (int j = 0; j < ns; j++) {
     (*slst)[l] = (*slst)[j];
     for (int k = 0; k < l; k++) {
       if (strcmp((*slst)[k], (*slst)[j]) == 0) {
         free((*slst)[j]);
         l--;
+        break;
       }
     }
     l++;
   }
+  ns = l;
 
   // output conversion
   rl = (pAMgr) ? pAMgr->get_oconvtable() : NULL;
   for (int j = 0; rl && j < ns; j++) {
     if (rl->conv((*slst)[j], wspace)) {
       free((*slst)[j]);
       (*slst)[j] = mystrdup(wspace);
     }