Bug 710967 - Incorrect argument passed to strncmp in AffixMgr::parse_convtable. r=gavin
authorJared Wein <jwein@mozilla.com>
Thu, 15 Dec 2011 22:10:11 -0800
changeset 84417 c6346cddd3c04ea781004ee4167d7e93226bb50d
parent 84416 cb4feeed6ac567ec628846beed512776df271b6f
child 84418 18d3b3a1f6052cd5dca459eaa59e90b4de9388d6
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs710967
milestone11.0a1
Bug 710967 - Incorrect argument passed to strncmp in AffixMgr::parse_convtable. r=gavin
extensions/spellcheck/hunspell/src/README.hunspell
extensions/spellcheck/hunspell/src/affixmgr.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.3.2
-Additional Patches: 
+Additional Patches: Bug 710967
 
 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/affixmgr.cpp
+++ b/extensions/spellcheck/hunspell/src/affixmgr.cpp
@@ -3700,17 +3700,17 @@ int  AffixMgr::parse_convtable(char * li
         i = 0;
         char * pattern = NULL;
         char * pattern2 = NULL;
         piece = mystrsep(&tp, 0);
         while (piece) {
            if (*piece != '\0') {
                switch(i) {
                   case 0: {
-                             if (strncmp(piece, keyword, sizeof(keyword)) != 0) {
+                             if (strncmp(piece, keyword, strlen(keyword)) != 0) {
                                  HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum());
                                  delete *rl;
                                  *rl = NULL;
                                  return 1;
                              }
                              break;
                           }
                   case 1: { pattern = mystrrep(mystrdup(piece),"_"," "); break; }