summarylogtreecommitdiffstats
path: root/0002-exit-on-MAX_PREFIXES_SUFFIXES.patch
blob: b3ff146f1f0fced51ff82e2084eb1c012e32cc3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff -aurN 0001/src/tools/munch.cxx 0002/src/tools/munch.cxx
--- 0001/src/tools/munch.cxx
+++ 0002/src/tools/munch.cxx
@@ -361,11 +361,21 @@
         nptr++;
       }
       if (ft == 'P') {
+              if (numpfx == MAX_PREFIXES) {
+                  fprintf(stderr,"MAX_PREFIXES (%d) reached.",MAX_PREFIXES);
+                  fprintf(stderr,"please edit value in src/tools/munch.h and rebuild hunspell\n");
+                  exit(1);
+              }
         ptable[numpfx].aep = ptr;
         ptable[numpfx].num = numents;
         fprintf(stderr, "ptable %d num is %d\n", numpfx, ptable[numpfx].num);
         numpfx++;
       } else {
+             if (numsfx == MAX_SUFFIXES) {
+                 fprintf(stderr,"MAX_SUFFIXES (%d) reached.",MAX_SUFFIXES);
+                 fprintf(stderr,"please edit value in src/tools/munch.h and rebuild hunspell\n");
+                 exit(1);
+             }
         stable[numsfx].aep = ptr;
         stable[numsfx].num = numents;
         fprintf(stderr, "stable %d num is %d\n", numsfx, stable[numsfx].num);